Re: Parse Error on SQL Insert

From: Date: Fri, 07 Apr 2006 19:58:07 +0000
Subject: Re: Parse Error on SQL Insert
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-233475@lists.php.net to get a copy of this message
On Friday 07 April 2006 12:53, Joe Henry wrote: > On Friday 07 April 2006 1:37 pm, Tom Chubb wrote: > > $insertSQL = "INSERT INTO cars (model, year, details, > > price, image1, > > Not sure if this is your problem, but those look like backticks around year > instead of single quotes. Should there even be quotes there? > > HTH > -- > Joe Henry > www.celebrityaccess.com > jhenry@celebrityaccess.com The backticks should be fine. They tell MySQL that you mean the column "year" of the table "cars" and not the MySQL special word "year" which can be used in date calculations. The same thing would apply if you wanted a column named "create". I would agree with John on the POST data. Make sure you at least run mysql_real_escape_string(). -- Ray Hauge Programmer/Systems Administrator American Student Loan Services www.americanstudentloan.com 1.800.575.1099

« previous php.general (#233475) next »