Fw: [PHP-DB] Special character on an INSERT statement

From: Date: Wed, 29 Aug 2001 09:33:28 +0000
Subject: Fw: [PHP-DB] Special character on an INSERT statement
Groups: php.db 
Request: Send a blank email to php-db+get-11946@lists.php.net to get a copy of this message
Hi again. I'm still trying but I can't do it. I have tried this : $values=$values.addslashes("'".$value).addslashes("'"); The result of this would be something like this INSERT INTO Carrocerias VALUES (\'Ber\',\' Berlina\') The mysql_errno is 1064. I've tried mysql_escape_tring with the same result. Before INSERT statement I put this mysql_escape_string("\"); but it didn't work. Can anyone where I could found an example ? I have looked on the online manual of php but they are SELECT examples, there are no INSERT examples. I ' m a newbie PHP programmer . Thanks again, Jorge Giménez ----- Original Message ----- From: "Jorge Giménez Mayorgas" <jorgegmamg@hotmail.com> To: <php-db@lists.php.net> Sent: Tuesday, August 28, 2001 6:48 PM Subject: [PHP-DB] Special character on an INSERT statement Hi . I'm trying to do this on an INSERT statement. $sql= "INSERT .... (' TONS OF CD'S ') or any phrase with the character ' . Obviously it gives an error when execeting mysql_query. How can I do it ? Thanks, Jorge Giménez

« previous php.db (#11946) next »