Hi, I 'm using MySQL5 and I am trying to set up a table through phpMyAdmin on my server. The code I am using is as follows: mysql_query("CREATE TABLE validate( id INT(4) NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), url VARCHAR(128), flag INT(1) DEFAULT '0', email varchar(50) )") or die(mysql_error()); I'm new to MySQL but the code looked OK to me, however I keep getting the following error: #1064 - 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 'mysql_query("CREATE TABLE validate( id INT(4) NOT NULL AUTO_INCREMENT, PRIMARY' at line 1 Obviously there is an error there that I am not seeing. Can anyone show me where it is? Thanks.
Try just this: CREATE TABLE validate( id INT(4) NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), url VARCHAR(128), flag INT(1) DEFAULT '0', email varchar(50) ); Code (markup): The mysql_query is specific to php. You need to use just the sql syntax when querying through phpmyadmin or any other command line interface.