INSERT - PHP functions that ignores bad input such as ' &
Posted: Fri May 23, 2003 11:52 am
Hi there, I'm having a problem when I try to INSERT text within a MySQL database, if this text has quotes in it, is there any function to ignore them so that the INSERT doesn't throws a error?
if the $txt_text doesn't has quotes it works fine, but if it is something like : " Hello I'm ... " it ignores the data and keeps the old one, if i am editing an existing data of course, I haven't tried while i'm inserting...
Thanks in advance...
Code: Select all
function insertForm($txt_name,$txt_text){
$query="INSERT INTO table_name(id, desc) VALUES ('$txt_name','$txt_text')";
$result=$this->cDb->executeQuery($query);
return $result;
}Thanks in advance...