Forums
This topic is locked
mysql/php SQL error syntax
Posted 04 Jun 2002 15:58:31
1
has voted
04 Jun 2002 15:58:31 Ken Carter posted:
I am getting the following error message on a page that is attemtting to insert into a table.You have an error in your SQL syntax near 'desc,qty,ship,weight,cost,color) VALUES ('3cfcb712313c8','819','Weed it and weep' at line 1
This is on a MySQL server and the insert is being done from PHP. I will hold off posting the code here till it is requested that generates this error, in hopes that some of you sql masters might see something in the error message that leaps out at you. Since it is php driven I'll either have to email or post the code for anyone to see that needs to.
The code itself is fairly vanilla from Tim Green's IntelliCart extension. Tim is away right now and I'm hoping to find a resolution for the problem today if at all possible.
Thanks,
Ken Carter
Replies
Replied 05 Jun 2002 10:20:05
05 Jun 2002 10:20:05 Julio Taylor replied:
Your problem could be a number of things but off hand i think that it maight be an issue with single quotes.... are you trying to insert any values with single quotes? I know there are issues with that in MySQL and although there are ways to get around it, many people don't know about it.
I spent weeks trying to fix an SQL error very similar to the one you're getting once and it turned out to be the single quotes. I'm not entirely sure how to fix this error, but it might give you a good pointer on where to do some research or how to question your hosting company on the issue.
i hope this helps.
--J
P.S. i killed kenny
I spent weeks trying to fix an SQL error very similar to the one you're getting once and it turned out to be the single quotes. I'm not entirely sure how to fix this error, but it might give you a good pointer on where to do some research or how to question your hosting company on the issue.
i hope this helps.
--J
P.S. i killed kenny
Replied 05 Jun 2002 12:23:19
05 Jun 2002 12:23:19 Ken Carter replied:
Got it resolved!
What it amounted to was that apparently desc is a reserved word and it was choaking on that big time. The single quotes were just fine. It did take a while to debug it but only about 12 hours of fussing with it... and of couse when you finally find the little critter you look at it and go 'duh!' .. Thanks for the input.
PS: I AM KENNY!!!
Ken....
What it amounted to was that apparently desc is a reserved word and it was choaking on that big time. The single quotes were just fine. It did take a while to debug it but only about 12 hours of fussing with it... and of couse when you finally find the little critter you look at it and go 'duh!' .. Thanks for the input.
PS: I AM KENNY!!!
Ken....