PDA

View Full Version : Help with code please.


David Coutts
03-07-2004, 05:00 PM
INSERT INTO setting (settingid,settinggroupid,title,varname,value,desc ription,optioncode,displayorder) VALUES (NULL,1,'What usergroups can view the board while it\'s off','canviewclosed','6,5,7','What usergroups can view the board even if it\'s closed (seperate with a comma)','','3')


Is there anything wrong with that? Because when I try to go Query the DB, it says the following, basically that I have a Syntax Error, and seeing as I'm hopeless at whatever that is, I can't tell what's wrong with it.


Database error in vBulletin Control Panel 2.2.9:

Invalid SQL: INSERT INTO setting (settingid,settinggroupid,title,varname,value,desc ription,optioncode,displayorder) VALUES (NULL,1,'What usergroups can view the board while it's off','canviewclosed','6,5,7','What usergroups can view the board even if it's closed (seperate with a comma)','','3')

mysql error: 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 's off','canviewclosed','6,5,7','What usergroups can view the bo

mysql error number: 1064

NTLDR
03-07-2004, 09:31 PM
optioncode,displayorde r)

If the space atually exists between the e and the r it shouldn't.

Xenon
03-07-2004, 09:49 PM
the space comes from the autowrapping long strings ;)

actually the error occurs becasue of the unescaped ' here: if it's closed

David Coutts
03-08-2004, 01:31 AM
Thank you so much. I'll go take a peek, and see if that allows me to do it. I'll post again in a minute, with an update. Thanks again.

David Coutts
03-08-2004, 01:35 AM
Woah, thanks so much. I had a problem, but I re-read your instructions, and it works now. Thanks so much, guys!

Xenon
03-09-2004, 05:44 PM
glad we could help :)