Forum Moderators: coopster

Message Too Old, No Replies

mysql add column

         

ayushchd

7:31 am on May 9, 2007 (gmt 0)

10+ Year Member



$date = date("F j, Y");
$new = "ALTER TABLE closing ADD May 9, 2007 VARCHAR(30) NOT NULL;";

Is this wrong? mysql says :

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 '9, 2007 VARCHAR(30) NOT NULL' at line 1

Whts The prob?

ayushchd

7:36 am on May 9, 2007 (gmt 0)

10+ Year Member



Sorry my mysql query is :

$new = "ALTER TABLE closing ADD $date VARCHAR(30) NOT NULL;";

henry0

11:04 am on May 9, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What is wrong?
I tried it with:
<<<<
ALTER TABLE articles ADD aaaa VARCHAR(30) NOT NULL;
>>>>
which worked fine!
So your problem might be the var values
did you try echoing each of those two?