Re: Problem with script
| From: | Robby Russell | Date: | Tue, 02 Nov 2004 16:59:03 +0000 |
| Subject: | Re: Problem with script | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-37150@lists.php.net to get a copy of this message | ||
On Tue, 2004-11-02 at 10:41 -0600, renato.linux@desertcomputers.com
wrote:
> 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
My initial guess is that you do not have magic quotes on.
You might want to validate your data before inserting it into the
database.
Try: http://us2.php.net/manual/en/function.mysql-escape-string.php
Any instances of "'" will break your INSERT query the way you have
it..so you need to insert them all with \' (which escapes the single
quotes)
hth,
Robby
--
/***************************************
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON | www.planetargon.com
* Portland, OR | robby@planetargon.com
* 503.351.4730 | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
* --- Now supporting PHP5 ---
****************************************/
Attachment: [application/pgp-signature] This is a digitally signed message part signature.asc
Attachment: [application/pgp-signature] This is a digitally signed message part signature.asc