i have the following table construction:
CREATE TABLE cart (
cartnum varchar(255) NOT NULL default '0',
customerID int(11) NOT NULL default '0',
enteredOn date NOT NULL default '0000-00-00',
authorise int(11) default NULL,
authorisedon date default NULL,
UNIQUE KEY id (cartnum)
) TYPE=MyISAM;
and i am trying to do the following php:
$date = date("Y-m-d");
$sql = "INSERT into cart (cartnum, customerID, enteredOn) values ($a, $b, $date)";
mysql_query($sql) or die (mysql_error());
and get the following error:
You have an error in your SQL syntax near ' 2004-09-07)' at line 1
Can anyone see why?
thanx in advance