Welcome Guest, Not a member yet? Register   Sign In
About the model class
#1

[eluser]ted wong[/eluser]
First, I would like to know, If I use this method to insert a record in my db, like this:

Code:
$new_user = array(
            'username' => $this->input->post('username')
                );

        $insert = $this->db->insert('users', $new_user);

Then, I would like to know will the insert method do the escape special character or not? do I need to do it manually?
If yes, is there any easy way to do escaping the data to avoid SQL injection.
Further more, if it is not escaped, I will have some where to do sanitize data, where should I do? and where should I put? put this logic in the model or controller is more suitable? Also, any way to do sanitize in CodeIgniter? Thank you. (I did the form_validation, but some logic check , like the user cannot have same username, where should I put the logic? Thank you. )


Messages In This Thread
About the model class - by El Forum - 08-10-2011, 03:16 AM
About the model class - by El Forum - 08-10-2011, 04:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB