Just read this on Stack overflow and thus left me wondering if SQL injection is possible through active records in CI.
At most of the places in my project, for user registration and user profile update, I have done SQL insertions like this :
Controller :
$name = $this->input->post('name');
$last_name = $this->input->post('last_name');
$age = $this->input->post('dob');
$user_data = array(
'name' => $name,
'last_name' => $last_name,
'age' => $age
);
$this->user_model->add_user_function($user_data);
Model:
function add_user_function($data)
{
$this->db->insert('user_table',$data);
return;
}
Just like the example in the SO link above, is my code vulerable to SQL injection?
Can you give a particular example if it is possible to harm my system, and how can I prevent if it exists.