J'ai cette erreur Uncaught Error: Call to a member function fetch() on bool
kent
-
jordane45 Messages postés 38486 Date d'inscription Statut Modérateur Dernière intervention -
jordane45 Messages postés 38486 Date d'inscription Statut Modérateur Dernière intervention -
Bonjour, j'ai cette erreur or ma requete est juste dans mySql < Uncaught Error: Call to a member function fetch() on bool>
while ( $item=$statement ->fetch())
{
echo '<tr>';
echo '<td>'.$item['name'].'</td>';
echo '<td>'.$item['description'].'</td>';
echo '<td>'.number_format((float)$item['price'],2,'.','').'</td>';
echo '<td>'.$item['category'].'</td>';
echo '<td>';
echo '<a class="btn btn-default" href="view.php?id= '.$item['id'].'"><img src="../MDB-Free_4.8.7/node_modules/bootstrap-icons/icons/eye.svg">Voir</a>';
echo ' ';
echo '<a class="btn btn-primary" href="update.php?id='.$item['id'].'"><img src="../MDB-Free_4.8.7/node_modules/bootstrap-icons/icons/pencil.svg">Modifier</a>';
echo ' ';
echo '<a class="btn btn-danger" href="delete.php?id='.$item['id'].'">Supprinmer</a>';
echo '</td>';
echo '</tr>';
}
while ( $item=$statement ->fetch())
{
echo '<tr>';
echo '<td>'.$item['name'].'</td>';
echo '<td>'.$item['description'].'</td>';
echo '<td>'.number_format((float)$item['price'],2,'.','').'</td>';
echo '<td>'.$item['category'].'</td>';
echo '<td>';
echo '<a class="btn btn-default" href="view.php?id= '.$item['id'].'"><img src="../MDB-Free_4.8.7/node_modules/bootstrap-icons/icons/eye.svg">Voir</a>';
echo ' ';
echo '<a class="btn btn-primary" href="update.php?id='.$item['id'].'"><img src="../MDB-Free_4.8.7/node_modules/bootstrap-icons/icons/pencil.svg">Modifier</a>';
echo ' ';
echo '<a class="btn btn-danger" href="delete.php?id='.$item['id'].'">Supprinmer</a>';
echo '</td>';
echo '</tr>';
}
A voir également:
- Uncaught error: call to a member function fetch()
- Qwerty to azerty - Guide
- Eespt technical error ✓ - Forum TNT / Satellite / Réception
- A javascript error occurred in the main process - Forum Matériel & Système
- Video to video - Télécharger - Conversion & Codecs
- Press del to enter setup ✓ - Forum Windows
1 réponse
bonjour,
Commence par appliquer ceci : https://forums.commentcamarche.net/forum/affich-37584941-php-pdo-gerer-les-erreurs
PS: a l'avenir, merci d'utiliser les balises de code:
Explications sur l'utilisation des balises de code à lire entièrement ici : https://codes-sources.commentcamarche.net/faq/11288-poster-un-extrait-de-code
Commence par appliquer ceci : https://forums.commentcamarche.net/forum/affich-37584941-php-pdo-gerer-les-erreurs
PS: a l'avenir, merci d'utiliser les balises de code:
Explications sur l'utilisation des balises de code à lire entièrement ici : https://codes-sources.commentcamarche.net/faq/11288-poster-un-extrait-de-code