par
max303 » 29 janv. 2022, 15:29
Bonjour or1, merci pour ta réponse.
La fin réelle du message d'erreur est la suivante:
) Fatal error: Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 Erreur de syntaxe près de '' à la ligne 1 in C:\wamp64\www\Projetsite\principales\affichage.php on line 11
( ! ) PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 Erreur de syntaxe près de '' à la ligne 1 in C:\wamp64\www\Projetsite\principales\affichage.php on line 11
La ligne 11 correspond à celle là
$stmt->execute();
Et le vardump de count pour la cat principale dont id_parent =0:
C:\wamp64\www\Projetsite\principales\affichage.php:10:string 'SELECT COUNT(id) AS cpt FROM annonces WHERE id=1' (length=48)
=>Donc l'id parent.
Pour les sous-catégories, le vardump:
C:\wamp64\www\Projetsite\principales\affichage.php:10:string 'SELECT COUNT(id) AS cpt FROM annonces WHERE id=101' (length=50)]
Ici c'est la première sous-categorie.
J'espère que ça répondà tes questions
Bonjour or1, merci pour ta réponse.
La fin réelle du message d'erreur est la suivante:
) Fatal error: Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 Erreur de syntaxe près de '' à la ligne 1 in C:\wamp64\www\Projetsite\principales\affichage.php on line 11
( ! ) PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 Erreur de syntaxe près de '' à la ligne 1 in C:\wamp64\www\Projetsite\principales\affichage.php on line 11
La ligne 11 correspond à celle là [PHP]$stmt->execute();[/PHP]
Et le vardump de count pour la cat principale dont id_parent =0: [PHP]C:\wamp64\www\Projetsite\principales\affichage.php:10:string 'SELECT COUNT(id) AS cpt FROM annonces WHERE id=1' (length=48)[/PHP]
=>Donc l'id parent.
Pour les sous-catégories, le vardump: [PHP]C:\wamp64\www\Projetsite\principales\affichage.php:10:string 'SELECT COUNT(id) AS cpt FROM annonces WHERE id=101' (length=50)][/PHP] Ici c'est la première sous-categorie.
J'espère que ça répondà tes questions