Problème avec easyphp

Fermé
mae.. - Modifié par Whismeril le 8/09/2015 à 18:42
Konseil Messages postés 643 Date d'inscription samedi 29 août 2015 Statut Membre Dernière intervention 13 novembre 2018 - 8 sept. 2015 à 23:26
Bonjour
CREATE TABLE Employé (
  Matricule VARCHAR(20) NOT NULL AUTO_INCREMENT,
  Nom VARCHAR(20) NOT NULL,
  Prénom VARCHAR(20) NULL,
  Poste_employé VARCHAR(20) NULL,
  N°tel INTEGER UNSIGNED NULL,
  PRIMARY KEY(Matricule, Nom)
);

CREATE TABLE Fournisseur (
  Matricule VARCHAR(20) BINARY NOT NULL AUTO_INCREMENT,
  Nom TEXT NULL,
  Prénom TEXT NULL,
  N°tel INTEGER UNSIGNED NULL,
  Résidence TEXT NULL,
  Ets_Fournisseur TEXT NULL,
  PRIMARY KEY(Matricule)
);

CREATE TABLE Service (
  Code_service VARCHAR(20) NOT NULL AUTO_INCREMENT,
  Employé_Nom VARCHAR(20) NOT NULL,
  Employé_Matricule VARCHAR(20) NOT NULL,
  Matricule_responsable VARCHAR(20) NULL,
  Responsable_service TEXT NULL,
  N°tel INTEGER UNSIGNED NULL,
  PRIMARY KEY(Code service, Employé_Nom, Employé_Matricule),
  INDEX Service_FKIndex2(Employé_Matricule, Employé_Nom),
  FOREIGN KEY(Employé_Matricule, Employé_Nom)
    REFERENCES Employé(Matricule, Nom)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION
);

CREATE TABLE Agence (
  Matricule VARCHAR(20) NOT NULL AUTO_INCREMENT,
  Nom_Agence TEXT NOT NULL,
  Service_Code_service VARCHAR(20) NOT NULL,
  Service_Employé_Matricule VARCHAR(20) NOT NULL,
  Service_Employé_Nom VARCHAR(20) NOT NULL,
  Ville TEXT NOT NULL,
  Chef_agence TEXT NULL,
  PRIMARY KEY(Matricule, Nom_Agence, Service_Code_service, Service_Employé_Matricule, Service_Employé_Nom),
  INDEX Agence_FKIndex2(Service_Code service, Service_Employé_Nom, Service_Employé_Matricule),
  FOREIGN KEY(Service_Code_service, Service_Employé_Nom, Service_Employé_Matricule)
    REFERENCES Service(Code_service, Employé_Nom, Employé_Matricule)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION
);

CREATE TABLE Commander (
  Quantité INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
  Fournisseur_Matricule VARCHAR(20) BINARY NOT NULL,
  Prix INTEGER UNSIGNED NULL,
  N°commande INTEGER UNSIGNED NULL,
  Date_heure DATETIME NULL,
  PRIMARY KEY(Quantité, Fournisseur_Matricule),
  INDEX Commander_FKIndex1(Fournisseur_Matricule),
  FOREIGN KEY(Fournisseur_Matricule)
    REFERENCES Fournisseur(Matricule)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION
);

CREATE TABLE Service_Immobilisation (
  Matricule VARCHAR(20) NOT NULL AUTO_INCREMENT,
  Commander_Fournisseur_Matricule VARCHAR(20) BINARY NOT NULL,
  Commander_Quantité INTEGER UNSIGNED NOT NULL,
  Responsable TEXT NULL,
  N°tel INTEGER UNSIGNED NULL,
  PRIMARY KEY(Matricule, Commander_Fournisseur_Matricule, Commander_Quantité),
  INDEX Service_Immobilisation_FKIndex1(Commander_Quantité, Commander_Fournisseur_Matricule),
  FOREIGN KEY(Commander_Quantité, Commander_Fournisseur_Matricule)
    REFERENCES Commander(Quantité, Fournisseur_Matricule)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION
);

CREATE TABLE Livrer (
  Quantité INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
  Fournisseur_Matricule VARCHAR(20) BINARY NOT NULL,
  Agence_Nom_Agence TEXT NOT NULL,
  Agence_Matricule VARCHAR(20) NOT NULL,
  Agence_Service_Code service VARCHAR(20) NOT NULL,
  Agence_Service_Employé_Nom VARCHAR(20) NOT NULL,
  Agence_Service_Employé_Matricule VARCHAR(20) NOT NULL,
  Nom_livreur TEXT NULL,
  N°tel NUMERIC NULL,
  Date_heure DATETIME NULL,
  PRIMARY KEY(Quantité, Fournisseur_Matricule, Agence_Nom_Agence, Agence_Matricule, Agence_Service_Code_service, Agence_Service_Employé_Nom, Agence_Service_Employé_Matricule),
  INDEX Livrer_FKIndex1(Fournisseur_Matricule),
  INDEX Livrer_FKIndex2(Agence_Matricule, Agence_Nom_Agence, Agence_Service_Code service, Agence_Service_Employé_Matricule, Agence_Service_Employé_Nom),
  FOREIGN KEY(Fournisseur_Matricule)
    REFERENCES Fournisseur(Matricule)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION,
  FOREIGN KEY(Agence_Matricule, Agence_Nom_Agence, Agence_Service_Code_service, Agence_Service_Employé_Matricule, Agence_Service_Employé_Nom)
    REFERENCES Agence(Matricule, Nom_Agence, Service_Code_service, Service_Employé_Matricule, Service_Employé_Nom)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION
);

CREATE TABLE Transmettre (
  date_heure DATETIME NOT NULL AUTO_INCREMENT,
  Employé_Nom VARCHAR(20) NOT NULL,
  Employé_Matricule VARCHAR(20) NOT NULL,
  Service_Employé_Matricule VARCHAR(20) NOT NULL,
  Service_Employé_Nom VARCHAR(20) NOT NULL,
  Service_Code_service VARCHAR(20) NOT NULL,
  Agence_Service_Employé_Nom VARCHAR(20) NOT NULL,
  Agence_Service_Employé_Matricule VARCHAR(20) NOT NULL,
  Agence_Service_Code_service VARCHAR(20) NOT NULL,
  Agence_Nom_Agence TEXT NOT NULL,
  Agence_Matricule VARCHAR(20) NOT NULL,
  Agence_emettteur TEXT NULL,
  Service_emettteur TEXT NULL,
  Employé_émetteur TEXT NULL,
  PRIMARY KEY(date_heure, Employé_Nom, Employé_Matricule, Service_Employé_Matricule, Service_Employé_Nom, Service_Code service, Agence_Service_Employé_Nom, Agence_Service_Employé_Matricule, Agence_Service_Code_service, Agence_Nom_Agence, Agence_Matricule),
  INDEX Transmettre_FKIndex1(Employé_Matricule, Employé_Nom),
  INDEX Transmettre_FKIndex2(Service_Code_service, Service_Employé_Nom, Service_Employé_Matricule),
  INDEX Transmettre_FKIndex3(Agence_Matricule, Agence_Nom Agence, Agence_Service_Code service, Agence_Service_Employé_Matricule, Agence_Service_Employé_Nom),
  FOREIGN KEY(Employé_Matricule, Employé_Nom)
    REFERENCES Employé(Matricule, Nom)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION,
  FOREIGN KEY(Service_Code_service, Service_Employé_Nom, Service_Employé_Matricule)
    REFERENCES Service(Code_service, Employé_Nom, Employé_Matricule)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION,
  FOREIGN KEY(Agence_Matricule, Agence_Nom_Agence, Agence_Service_Code_service, Agence_Service_Employé_Matricule, Agence_Service_Employé_Nom)
    REFERENCES Agence(Matricule, Nom_Agence, Service_Code_service, Service_Employé_Matricule, Service_Employé_Nom)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION
);

CREATE TABLE Renvoyer (
  Motif VARCHAR(255) NOT NULL AUTO_INCREMENT,
  Service_Immobilisation_Matricule VARCHAR(20) NOT NULL,
  Service _mmobilisation_Commander_Quantité INTEGER UNSIGNED NOT NULL,
  Service_Immobilisation_Commander_Fournisseur_Matricule VARCHAR(20) BINARY NOT NULL,
  Date_heure DATETIME NULL,
  PRIMARY KEY(Motif, Service_Immobilisation_Matricule, Service_Immobilisation_Commander_Quantité, Service_Immobilisation_Commander_Fournisseur_Matricule),
  INDEX Renvoyer_FKIndex1(Service_Immobilisation_Matricule, Service_Immobilisation_Commander_Fournisseur_Matricule, Service_Immobilisation_Commander_Quantité),
  FOREIGN KEY(Service_Immobilisation_Matricule, Service_Immobilisation_Commander_Fournisseur_Matricule, Service_Immobilisation_Commander_Quantité)
    REFERENCES Service_Immobilisation(Matricule, Commander_Fournisseur_Matricule, Commander_Quantité)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION
);

CREATE TABLE Diagnostiquer (
  Date_heure DATETIME NOT NULL AUTO_INCREMENT,
  Service_Immobilisation_Matricule VARCHAR(20) NOT NULL,
  Service_Immobilisation_Commander_Quantité INTEGER UNSIGNED NOT NULL,
  Service_Immobilisation_Commander_Fournisseur_Matricule VARCHAR(20) BINARY NOT NULL,
  PRIMARY KEY(Date_heure, Service_Immobilisation_Matricule, Service_Immobilisation_Commander_Quantité, Service_Immobilisation_Commander_Fournisseur_Matricule),
  INDEX Diagnostiquer_FKIndex1(Service_Immobilisation_Matricule, Service_Immobilisation_Commander_Fournisseur_Matricule, Service_Immobilisation_Commander_Quantité),
  FOREIGN KEY(Service_Immobilisation_Matricule, Service_Immobilisation_Commander_Fournisseur_Matricule, Service_Immobilisation_Commander_Quantité)
    REFERENCES Service_Immobilisation(Matricule, Commander_Fournisseur_Matricule, Commander_Quantité)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION
);

CREATE TABLE Matériel (
  N°serie INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
  Diagnostiquer_Date_heure DATETIME NOT NULL,
  Diagnostiquer_Service_Immobilisation_Matricule VARCHAR(20) NOT NULL,
  Diagnostiquer_Service_Immobilisation_Commander_Fournisseur_Matricule VARCHAR(20) BINARY NOT NULL,
  Diagnostiquer_Service_Immobilisation_Commander_Quantité INTEGER UNSIGNED NOT NULL,
  Nom_matériel TEXT NULL,
  Type_matériel TEXT NULL,
  Guarantie YEAR NULL,
  Marque TEXT NULL,
  Fournisseur TEXT NULL,
  PRIMARY KEY(N°serie, Diagnostiquer_Date_heure, Diagnostiquer_Service_Immobilisation_Matricule, Diagnostiquer_Servic_ Immobilisation_Commander_Fournisseur_Matricule, Diagnostiquer_Service_Immobilisation_Commander_Quantité),
  INDEX Matériel_FKIndex1(Diagnostiquer_Date_heure, Diagnostiquer_Service_Immobilisation_Matricule, Diagnostiquer_Service_Immobilisation_Commander_Quantité, Diagnostiquer_Service_Immobilisation_Commander_Fournisseur_Matricule),
  FOREIGN KEY(Diagnostiquer_Date_heure, Diagnostiquer_Service_Immobilisation_Matricule, Diagnostiquer_Service_Immobilisation_Commander_Quantité, Diagnostiquer_Service Immobilisation_Commander_Fournisseur_Matricule)
    REFERENCES Diagnostiquer(Date_heure, Service_Immobilisation_Matricule, Service_Immobilisation_Commander_Quantité, Service_Immobilisation_Commander_Fournisseur_Matricule)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION
);

CREATE TABLE Appartenir (
  Agence_Service_Employé_Nom VARCHAR(20) NOT NULL,
  Agence_Service_Employé_Matricule VARCHAR(20) NOT NULL,
  Agence_Service_Code_service VARCHAR(20) NOT NULL,
  Agence_Nom_Agence TEXT NOT NULL,
  Agence_Matricule VARCHAR(20) NOT NULL,
  Matériel_Diagnostiquer_Service_Immobilisation_Matricule VARCHAR(20) NOT NULL,
  Matériel_Diagnostiquer_Date_heure DATETIME NOT NULL,
  Matériel_N°serie INTEGER UNSIGNED NOT NULL,
  Service_Employé_Matricule VARCHAR(20) NOT NULL,
  Service_Employé_Nom VARCHAR(20) NOT NULL,
  Service_Code_service VARCHAR(20) NOT NULL,
  Employé_Nom VARCHAR(20) NOT NULL,
  Employé_Matricule VARCHAR(20) NOT NULL,
  PRIMARY KEY(Agence_Service_Employé_Nom, Agence_Service_Employé_Matricule, Agence_Service_Code_service, Agence_Nom_Agence, Agence_Matricule, Matériel_Diagnostiquer_Service_Immobilisation_Matricule, Matériel_Diagnostiquer_Date_heure, Matériel_N°serie, Service_Employé_Matricule, Service_Employé_Nom, Service_Code service, Employé_Nom, Employé_Matricule),
  INDEX Appartenir_FKIndex1(Agence_Matricule, Agence_Nom Agence, Agence_Service_Code_service, Agence_Service_Employé_Matricule, Agence_Service_Employé_Nom),
  INDEX Appartenir_FKIndex2(Matériel_N°serie, Matériel_Diagnostiquer_Date_heure, Matériel_Diagnostiquer_Service_Immobilisation_Matricule),
  INDEX Appartenir_FKIndex3(Service_Code_service, Service_Employé_Nom, Service_Employé_Matricule),
  INDEX Appartenir_FKIndex4(Employé_Matricule, Employé_Nom),
  FOREIGN KEY(Agence_Matricule, Agence_Nom_Agence, Agence_Service_Code_service, Agence_Service_Employé_Matricule, Agence_Service_Employé_Nom)
    REFERENCES Agence(Matricule, Nom_Agence, Service_Code_service, Service_Employé_Matricule, Service_Employé_Nom)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION,
  FOREIGN KEY(Matériel_N°serie, Matériel_Diagnostiquer_Date_heure, Matériel_Diagnostiquer_Service_Immobilisation_Matricule, Matériel_Diagnostiquer_Service Immobilisation_Commander_Fournisseur_Matricule, Matériel_Diagnostiquer_Service_Immobilisation_Commander_Quantité)
    REFERENCES Matériel(N°serie, Diagnostiquer_Date_heure, Diagnostiquer_Service_Immobilisation_Matricule, Diagnostiquer_Service_Immobilisation_Commander_Fournisseur_Matricule, Diagnostiquer_Service_Immobilisation_Commander_Quantité)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION,
  FOREIGN KEY(Service_Code_service, Service_Employé_Nom, Service_Employé_Matricule)
    REFERENCES Service(Code_service, Employé_Nom, Employé_Matricule)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION,
  FOREIGN KEY(Employé_Matricule, Employé_Nom)
    REFERENCES Employé(Matricule, Nom)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION
);


voici le message ke sql m'a envoyé

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 '? (
Matricule VARCHAR(20) NOT NULL AUTO_INCREMENT,
Nom VARCHAR(20) NOT NUL' at line 1 jour,

EDIT : Ajout des balises de code (la coloration syntaxique).
Explications disponibles ICI

Merci d'y penser dans tes prochains messages.
A voir également:

2 réponses

Konseil Messages postés 643 Date d'inscription samedi 29 août 2015 Statut Membre Dernière intervention 13 novembre 2018 428
8 sept. 2015 à 16:58
Salut, je pense que le problème de Employé, l'accent.
0
même après avoir enlever l'accent voiçi le message que sql envoi:
#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 ')' at line 7


voici le code sql:
CREATE TABLE Employe (
  Matricule VARCHAR(20) NOT NULL PRIMARY KEY,
  Nom VARCHAR(20) NOT NULL,
  Prénom VARCHAR(20) NULL,
  Poste_employé VARCHAR(20) NULL,
  N°tel INTEGER UNSIGNED NULL,
);


EDIT2 : Ajout des balises de code (la coloration syntaxique).
Explications disponibles ICI

Merci d'y penser dans tes prochains messages.


EDIT : Ajout de la balise de citation

<block>Texte cité ici</block>

Merci d'y penser dans tes prochains messages.
0
Whismeril Messages postés 19080 Date d'inscription mardi 11 mars 2003 Statut Contributeur Dernière intervention 6 juillet 2024 916
8 sept. 2015 à 18:50
Bonsoir, je ne suis pas spécialiste de la question, mais il y a cet article
https://www.commentcamarche.net/faq/43261-php-l-extension-mysql-est-obsolete

Et celui-ci
https://www.commentcamarche.net/faq/44117-connexion-a-une-base-avec-pdo-mysqli

Qui peuvent peut être t'intéresser
0
Konseil Messages postés 643 Date d'inscription samedi 29 août 2015 Statut Membre Dernière intervention 13 novembre 2018 428
8 sept. 2015 à 23:26
Supprime les caractères spéciaux:
ligne 6: N°tel.
0