RE: [PHP-DB] Problem with script
| From: | Russell Johnson | Date: | Tue, 02 Nov 2004 16:59:14 +0000 |
| Subject: | RE: [PHP-DB] Problem with script | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-37151@lists.php.net to get a copy of this message | ||
Just looking at the error message shows why it's failing in this case: "'t read
card','1099413551')' at line 1" One of the fields you're trying to
insert is likely 'Can't read card', and since in the query you are surrounding it
with single quotes, and it's coughing on the word Can't , which has a single quote.
Check out the add_slashes($str) function, which will add a backslash before the single quote, e.g.,
'Can\'t read card'. That should do the trick.
- Russ
-----Mensaje original-----
De: renato.linux@desertcomputers.com
[mailto:renato.linux@desertcomputers.com]
Enviado el: Tuesday, November 02, 2004 5:42 PM
Para: php-db@lists.php.net
Asunto: [PHP-DB] Problem with script
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