Re: script error

From: Date: Mon, 02 Aug 2004 11:36:18 +0000
Subject: Re: script error
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-192468@lists.php.net to get a copy of this message
Maybe unquote 'posts' -- I would write: $query = "INSERT INTO posts ( post_id , post_title , post_date , ...... On Monday 02 August 2004 06:49 am, me2resh wrote: > thanks for your help > > i did that > and here is the error message returned > > 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 ''posts' ( > post_id , post_title , > post_date , `post_author > > how can i fix it ? > > > -------Original Message------- > > From: John Holmes > Date: 08/02/04 13:45:22 > To: me2resh > Cc: php-general@lists.php.net > Subject: Re: [PHP] script error > > > $query = "insert into 'posts' ( post_id , > > post_title , post_date , > > post_author , post_content > > , m_cat_id , s_cat_id , > > post_pic) > > values (\'\', \'$post_title, \'$post_title, \'$post_author, > > \'$post_content, \'\', \'\', \'subject.gif\' )"; > > mysql_query($query); > > Change that last line to > > mysql_query($query) or die(mysql_error()); > > and run the script again. If you can't figure it out, post back with the > error message and what troubleshooting you've done. > -- > > John Holmes > > php|architect - The magazine for PHP professionals - > http://www.phparch.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#192468) next »