我的程序无法进行sql注入的安全扫描。以下是我将数据插入数据库的功能之一。请建议我应该如何修改我的代码以防止SQL注入。 提前谢谢。
public function set_timeline() {
$this->load->helper('url');
$this->load->helper('form');
$data = array(
'fiid' => $this->input->post('fiid'),
'project_id' => $this->input->post('project_id'),
'testing' => $this->input->post('testing'),
'start_date' => $this->input->post('start_date'),
'end_date' => $this->input->post('end_date'),
'description' => $this->input->post('description'),
'project_progress' => $this->input->post('project_progress'),
'tester' => $this->input->post('tester'),
'status' => $this->input->post('status')
);
$this->db->insert('timeline',$data);
if ($this->db->affected_rows() > 0) {
echo '<script>alert("Timeline Added Successfully"); window.history.back(); </script>';
}
else {
echo '<script>alert("Timeline already exist!"); window.history.back();</script>';
}
}