pinochio Posted October 1, 2009 Share Posted October 1, 2009 Hi I placed this SQL statement into my php script but it says this:"Unable to create the attendees table. Error code 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 'SMALL INT NOT NULL AUTO_INCREMENT PRIMARY KEY, firstName VARCHAR(40), lastName V' at line 1" if (!$QueryResult) { $SQLstring = "CREATE TABLE $TableName (attendeeID SMALL INT NOT NULL AUTO_INCREMENT PRIMARY KEY, firstName VARCHAR(40), lastName VARCHAR(40), homeaddress VARCHAR(40), homecity VARCHAR(40),homestate VARCHAR(2),homezip VARCHAR(10), homephone VARCHAR(40),homeemail VARCHAR(40),)"; $QueryResult = @mysqli_query($DBConnect, $SQLstring) Quote Link to comment https://forums.phpfreaks.com/topic/176205-solved-mysql/ Share on other sites More sharing options...
cags Posted October 1, 2009 Share Posted October 1, 2009 SMALLINT is all one word, not SMALL INT, I think you will also get an error message because of the comma right at the end of the query. Quote Link to comment https://forums.phpfreaks.com/topic/176205-solved-mysql/#findComment-928580 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.