Problème insertion bdd
clement.enj
Messages postés
8
Date d'inscription
Statut
Membre
Dernière intervention
-
yg_be Messages postés 23541 Date d'inscription Statut Contributeur Dernière intervention -
yg_be Messages postés 23541 Date d'inscription Statut Contributeur Dernière intervention -
BONJOUR,
Uncaught exception 'PDOException' with message ' in /var/www/RT/1Projet17/Site Web Final/php/reservation_one_client.php on line 68
( ! ) PDOException: SQLSTATE[23514]: Check violation: 7 ERROR: new row for relation "sejours" violates check constraint "sejours_check" DETAIL: Failing row contains (15, 92, 1, 1, 1, 11, 2017-06-12, 2017-06-12, null, 16, 12, 12, 10). in /var/www/RT/1Projet17/Site Web Final/php/reservation_one_client.php on line 68
Call Stack
aider moi svp j'ai un gros soucis et je dois finir de dev mon site ....
EDIT2 : Accessoirement ... on commence par dire BONJOUR. (je l'ai ajouté....)
$req = $pdo->prepare('INSERT INTO sejours (refclient, reftype , refetat , refadmin , nbpetitdej , datedebut , datefin , nbadultes , nbenfants , nbbebes, qte) VALUES ('.$idclient.', '.$reftype.','.$refetat.', '.$refadmin.' , :vardejeune , :vardatedebut, :vardatefin, :varadultes, :varenfants, :varbebe , :qte)'); $req->bindValue(':vardejeune',$_POST['nbpetitdej'], PDO::PARAM_INT); $req->bindValue(':vardatedebut',date('Y/m/j'), PDO::PARAM_STR); $req->bindValue(':vardatefin',date('Y/m/j'), PDO::PARAM_STR); $req->bindValue(':varadultes' ,$_POST['nbadultes'], PDO::PARAM_INT); $req->bindValue(':varenfants', $_POST['nbenfants'], PDO::PARAM_INT); $req->bindValue(':varbebe', $_POST['nbbebes'], PDO::PARAM_INT); $req->bindValue(':qte', $_POST['qte'], PDO::PARAM_INT); $req->execute();
Uncaught exception 'PDOException' with message ' in /var/www/RT/1Projet17/Site Web Final/php/reservation_one_client.php on line 68
( ! ) PDOException: SQLSTATE[23514]: Check violation: 7 ERROR: new row for relation "sejours" violates check constraint "sejours_check" DETAIL: Failing row contains (15, 92, 1, 1, 1, 11, 2017-06-12, 2017-06-12, null, 16, 12, 12, 10). in /var/www/RT/1Projet17/Site Web Final/php/reservation_one_client.php on line 68
Call Stack
aider moi svp j'ai un gros soucis et je dois finir de dev mon site ....
EDIT : Ajout du LANGAGE dans les balises de code (la coloration syntaxique).
Explications disponibles ici :ICIMerci d'y penser dans tes prochains messages.Jordane45 |
EDIT2 : Accessoirement ... on commence par dire BONJOUR. (je l'ai ajouté....)
A voir également:
- Problème insertion bdd
- Insertion sommaire word - Guide
- Touche insertion clavier - Guide
- Insertion filigrane word - Guide
- Insertion liste déroulante excel - Guide
- Insertion signature word - Guide
1 réponse
yg_be
Messages postés
23541
Date d'inscription
Statut
Contributeur
Dernière intervention
Ambassadeur
1 584
bonsoir, comment as-tu défini ta contrainte sejours_check?
CHECK (datedebut < datefin)
Supprimer
sejours_datedebut_check
CHECK (datedebut >= 'now'::text::date)
Supprimer
sejours_pkey
PRIMARY KEY (idsejour)
Supprimer
sejours_refadmin_fkey
FOREIGN KEY (refadmin) REFERENCES admins(idadmin) ON UPDATE CASCADE ON DELETE RESTRICT
Supprimer
sejours_refclient_fkey
FOREIGN KEY (refclient) REFERENCES clients(idclient) ON UPDATE CASCADE ON DELETE CASCADE
Supprimer
sejours_refetat_fkey
FOREIGN KEY (refetat) REFERENCES etats(idetat) ON UPDATE CASCADE ON DELETE RESTRICT
Supprimer
sejours_reftype_fkey
FOREIGN KEY (reftype) REFERENCES clients(idclient) ON UPDATE CASCADE ON DELETE CASCADE