Re: SQL Error

From: Date: Thu, 02 Aug 2001 13:36:12 +0000
Subject: Re: SQL Error
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-10993@lists.php.net to get a copy of this message
Have you tried with NULL instead of '' the ContactID? On Thu, 2 Aug 2001, Steve Fitzgerald wrote: > I keep getting the following SQL error: > > You have an error in your SQL syntax near ')' at line 14 > > Line 14 is: '$FirstName', so the error must correspond to a different part > of the code. > > Any ideas? > > $add_contact_sql = "INSERT INTO $table_name > (ContactID, FirstName, LastName, Title, WorkPhone, > HomePhone,Mobile,EmailName,Birthday,CompanyID) > VALUES > ('', > '$FirstName', > '$LastName', > '$Title', > '$WorkPhone', > '$HomePhone', > '$Mobile', > '$EmailName', > '$Birthday', > '$ContactID', > )"; > > $result = @mysql_query($add_contact_sql, $connection) or die > (mysql_error()); > ?> > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.db (#10993) next »