Web Hosting Talk







View Full Version : 1064: You have an error in your SQL syntax


lbeachmike
11-02-2008, 05:49 PM
1064: You have an error in your SQL syntax

I am getting an error in a website that has been moved from a server running MySQL 5 to MySQL 4.1 -
Can anybody help identify the syntactical error in the below?
Thanks!
1064: 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 ' bambini = , ip_user = '69.113.140.193', creation_date = date('2008-11-0' at line 12
INSERT INTO reservation SET nome = '', cognome = '', richiesta = '', email = '', tel = '', paese = '', edificio = 'either', tipo_stanza = 'any', data_in = '--', data_out = '--', flex = '', adulti = , bambini = , ip_user = '69.113.140.193', creation_date = date('2008-11-02')





__________________Decomodo.com - Cool stuff you seriously need!HostPremiums.com - Hosting Deals - Get your company listed today.

foobic
11-02-2008, 06:15 PM
It looks like your quotes, commas and equals may be wrong, but it's hard to tell from what you've posted. Try changing the relevant line to a print statement temporarily so you get the exact query your program is trying to send to MySQL.
Edit: alternatively, this:
Quote:


the right syntax to use near ' bambini = , ip


appears to suggest you just have no value for bambini in the query.





__________________
Chris <ClonePanel>
"Not everything that can be counted counts, and not everything that counts can be counted" - Albert Einstein






Last edited by foobic : 11-02-2008 at 05:18 PM.

lbeachmike
11-02-2008, 07:13 PM
Thanks.
Actually, I was able to learn that the issue was the missing quotes for these two entries -
adulti = , bambini =
Thus, they needed to be changed to -
adulti = '', bambini = ''
Thanks so much for your response.
Mike





__________________Decomodo.com - Cool stuff you seriously need!HostPremiums.com - Hosting Deals - Get your company listed today.