RE: [PHP-DB] Problem with script
| From: | Bastien Koert | Date: | Tue, 02 Nov 2004 16:56:48 +0000 |
| Subject: | RE: [PHP-DB] Problem with script | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-37149@lists.php.net to get a copy of this message | ||
from the brief error message your provided, I think its blowing up on the single quote contained in the word "can't". you need to handle this by choosing one a few of these methods
replace all single quotes with two single quotes
$text = str_replace("'","''", $text);
addslashes function
$text = addslashes($text);
or mysql_real_escape_string($sql);
bastien
From: renato.linux@desertcomputers.com To: php-db@lists.php.net Subject: [PHP-DB] Problem with script Date: Tue, 2 Nov 2004 10:41:35 -0600 (CST) Hi all, greetings from Phoenix, Arizona! I'm having a problem with a PHP script and the database it manages. I'm having his error message: Query failed: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 't read card','1099413551')' at line 1 I don't know what is happening, usually the database works well but sometimes this strange error appears. I'm sending you the scripts in where I think the error could be. Any suggestion or comment will be very appreciated. Thanks Renato << submit_temp.php >> -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php