RE: [PHP] SQL Error

From: Date: Tue, 31 Dec 2002 04:14:19 +0000
Subject: RE: [PHP] SQL Error
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-129728@lists.php.net to get a copy of this message
I don't think there's anything wrong with the queries themselves. Are you trying to run them all at once? You're getting an error because MySQL is reaching a semi-colon somewhere and that's causing a parse error... Show how you're trying to run all of these queries. Bottom line, you must do them one at a time with mysql_query, or run them through the command line in a file. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -----Original Message----- From: Stephen [mailto:webmaster@melchior.us] Sent: Monday, December 30, 2002 7:15 PM To: PHP List Subject: [PHP] SQL Error I'm having some troubles. I have an install script which runs a lot of SQL statements to create tables then insert info into them. One of them is an emoticons table. Here's the error I'm getting:   You have an error in your SQL syntax near '; INSERT INTO c_emotes VALUES \(':\)', 'emotes/smile.gif'\); INSERT INTO c_emo' at line 4   or, if I change my code a little, it's this:   You have an error in your SQL syntax near '; INSERT INTO c_emotes VALUES \(':)', 'emotes/smile.gif'\); INSERT INTO c_emo' at line 4   Here's my code which inserts the information:   INSERT INTO c_emotes VALUES (':)', 'emotes/smile.gif'); // I also have tried placing a \ infront of the )...no luck INSERT INTO c_emotes VALUES (';)', 'emotes/wink.gif'); INSERT INTO c_emotes VALUES (':(', 'emotes/sad.gif'); INSERT INTO c_emotes VALUES (':P', 'emotes/tounge.gif'); INSERT INTO c_emotes VALUES (':|', 'emotes/blank.gif'); INSERT INTO c_emotes VALUES (':-|', 'emotes/blank.gif'); INSERT INTO c_emotes VALUES (':-)', 'emotes/smile.gif'); INSERT INTO c_emotes VALUES (';-)', 'emotes/wink.gif'); INSERT INTO c_emotes VALUES (':-P', 'emotes/tounge.gif'); INSERT INTO c_emotes VALUES (':-(', 'emotes/sad.gif');   Anyone see the problem?? Thanks, Stephen Craton http://www.melchior.us   "What is a dreamer that cannot persevere?" -- http://www.melchior.us

« previous php.general (#129728) next »