Re: Parse Error on SQL Insert

From: Date: Fri, 07 Apr 2006 20:02:08 +0000
Subject: Re: Parse Error on SQL Insert
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-233477@lists.php.net to get a copy of this message
thanks for the clarification, I guess the other solution would be to avoid using names with special meaning for column names... -B Ray Hauge wrote:
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().


« previous php.general (#233477) next »