Bonjour,
j'essaye déseperement de creer deux tables simple par le biais de phpmy admin avec un simplement relation entre ces deux table mais je n'y arrive pas.
Quand ma table Statut est crée pas de probleme
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 CREATE TABLE Statut ( Statut VARCHAR(20) NOT NULL, PRIMARY KEY (Statut) )ENGINE = `innoDB`;
Mais quand j'essaye d'executer ma table contacts j'ai el message d'erreur suivant:''#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 'INDEX (Statut), FOREIGN KEY (Statut) REFERENCES Statut(Statut) )ENGINE = `in' at line 11''
J'utilise phpmyadmin 3.1.1, Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i mod_autoindex_color PHP/5.2.8
Version du client MySQL: 5.1.30
Extension PHP: mysql
Quelqu'un pourrait m'aidrer?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 CREATE TABLE Contacts ( NomContact VARCHAR(20) NOT NULL, PrenomContact VARCHAR(20) NOT NULL, Statut VARCHAR(20) NOT NULL, Mail_pro VARCHAR(40) NULL, Mail_perso VARCHAR(40) NULL, Tel_pro INT(10) NULL, Tel_perso INT(10) NULL, Fax INT(10) NULL, PRIMARY KEY (NomContact, PrenomContact) INDEX (Statut), FOREIGN KEY (Statut) REFERENCES Statut(Statut) )ENGINE = `innoDB`;
Partager