MYSQLI escape string |
[eluser]jzmwebdevelopement[/eluser]
I am currently updating a section of code that uses mysql currently the escape string is structured like this: Code: $product_name = mysql_real_escape_string(trim($_POST['product_name'])); My issue is when I change the above string to Code: $product_name = mysqli_real_escape_string($database, (trim($_POST['product_name']))); Code: $database = $this->load->database(); How do I escape a string with CI?
[eluser]LifeSteala[/eluser]
You should really be using CI native form validation class and use xss_clean which does all of that automatically. Also using $this->input->post() does the cleaning as well. Reference: http://ellislab.com/codeigniter/user-gui...greference http://ellislab.com/codeigniter/user-gui...input.html |
Welcome Guest, Not a member yet? Register Sign In |