J'ai cette erreur Uncaught Error: Call to a member function fetch() on bool

Fermé
kent - 24 juil. 2020 à 14:16
jordane45 Messages postés 38144 Date d'inscription mercredi 22 octobre 2003 Statut Modérateur Dernière intervention 21 avril 2024 - 24 juil. 2020 à 14:23
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>';
}

1 réponse

jordane45 Messages postés 38144 Date d'inscription mercredi 22 octobre 2003 Statut Modérateur Dernière intervention 21 avril 2024 4 650
24 juil. 2020 à 14:23
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
0