subuntug Posted February 20, 2010 Share Posted February 20, 2010 Hello;each time I try to create a table with PHPmyAdmin I get the same error. which is: "#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 'NOT NULL, `Nom` NOT NULL , `Prenom` NOT NULL , `Adresse` NULL, ' at line 2"There is my sql request : CREATE TABLE IF NOT EXISTS `mydb`.`ETUDIANTS` (`id` NOT NULL ,`Nom` NOT NULL ,`Prenom` NOT NULL ,`Adresse` NULL ,`CodePostal` NULL ,`Ville` NULL ,`Pays` NULL ,`Mail` NOT NULL ,`Telephone` NULL ,)PRIMARY KEY ( `id` ) ,ENGINE = InnoDB Can you tell me what wrong with my code ?Thanks in advance Link to comment Share on other sites More sharing options...
justsomeguy Posted February 23, 2010 Share Posted February 23, 2010 For one, you don't have any data types for your fields.http://dev.mysql.com/doc/mysql/en/create-table.html Link to comment Share on other sites More sharing options...
subuntug Posted February 23, 2010 Author Share Posted February 23, 2010 For one, you don't have any data types for your fields.http://dev.mysql.com/doc/mysql/en/create-table.html Thanks a lot, now I understand where is the problem. I didn't put the data type for the fields, because I thought that it was optional. Now I put the data type for each field and it works perfectly. Wonderful, you saved me a lot of headaches . Thanks again, and have a good day ! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.