Jump to content

Mysql Error 1064 (resolved)


Recommended Posts

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

Edited by subuntug
Link to comment
Share on other sites

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...