RE: Problem with script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxx
[mailto:renato.linux@xxxxxxxxxxxxxxxxxxx]
Enviado el: Tuesday, November 02, 2004 5:42 PM
Para: php-db@xxxxxxxxxxxxx
Asunto:  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

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux