[PHP] Parse error: unexpected T_FOR
Résolu
okuni
Messages postés
1221
Date d'inscription
Statut
Membre
Dernière intervention
-
okuni Messages postés 1221 Date d'inscription Statut Membre Dernière intervention -
okuni Messages postés 1221 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
J'ai une erreur dans un mon code PHP
voici le for en question :
Je ne comprend absolument pas pourquoi il y a ce bug.
Les variables SESSION sont correctement déclarée.
Merci.
J'ai une erreur dans un mon code PHP
Parse error: syntax error, unexpected T_FOR in /XXX/facture.php on line 13
voici le for en question :
for ($n = 0; $n < count($_SESSION['panier']['id_produit']); $n++) { $result = mysql_query('INSERT INTO eyself_achat (login,nom_produit,taille,couleur,nombre_produit,prix,date) VALUES ('.$_SESSION['login'].', '.$_SESSION['panier']['nom_produit'][$n].', '.$_SESSION['panier']['taille'][$n].', '.$_SESSION['panier']['couleur'][$n].', '.$_SESSION['panier']['quantite'][$n].', '.$_SESSION['panier']['prix'][$n].', NOW())'); if (!$result) { die ("Requête invalide : " . mysql_error()); } }
Je ne comprend absolument pas pourquoi il y a ce bug.
Les variables SESSION sont correctement déclarée.
Merci.
A voir également:
- Syntax error, unexpected 'for' (t_for)
- Downloader for pc - Télécharger - Téléchargement & Transfert
- Idm for mac - Télécharger - Téléchargement & Transfert
- Instagram for pc - Télécharger - Divers Communication
- Cmos checksum error ✓ - Forum Carte-mère/mémoire
- Playback error reconnect in 3s (1/5) francais - Forum Box et Streaming vidéo