PHP Error: Call to a member function fetch_assoc() on a non-object in PHP Error: Appel à une fonction membre fetch_assoc () sur un objet non dans
Posted on 23. Posté le 23. Jun, 2009 by Dragos in Coding , PHP Jun, 2009 par Dragos en codage, PHP
If you get this error: Call to a member function fetch_assoc() on a non-object in … , it means that you have an error in your mysql syntax. Si vous obtenez cette erreur: Appel à un membre de fonction fetch_assoc () sur un objet non-in ..., cela signifie que vous avez une erreur dans votre syntaxe MySQL. Supposing that $mysqli is your database connection object, put echo $mysqli->error; just before the line you're getting the error on. En supposant que $ mysqli est ton objet de connexion de base de données, mettre une commande echo $ mysqli-> error; juste avant la ligne que vous obtenez l'erreur de suite.
$mysqli=new mysqli(HOST,USER,PASS,DB); $ mysqli = new mysqli (HOST, USER, PASS, DB); $mQuery=$mysqli->query('select `data` from `this_table` where `id`=1'); mQuery $ = $ mysqli-> query ( 'data' SELECT `de` this_table `WHERE` id `= 1 '); echo $mysqli->error; //echoes that column `data` does not exist in table `this_table` echo $ mysqli-> error; / / affiche que les données de la colonne `n'existe pas dans la table` this_table ` $row=$mQuery->fetch_assoc(); //gives error as the column `data` is in table `that_table`, not in table `this_table` $ row = $ mQuery-> fetch_assoc (); / / donne une erreur que la colonne «données» est dans le tableau `that_table», pas dans la table `this_table` $mysqli->close(); $ mysqli-> close ();
Related posts: Related posts:
- Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: Reset Facilement passe de votre compte avec MySQL et PHP
- Coding:How to fetch user profile data with SSI.php from a SMF forum database Coding: Comment récupérer des données de profil utilisateur avec SSI.php à partir d'une base de données forum SMF
- JavaScript: How to get the index (position within a group) of an object with jQuery? JavaScript: Comment obtenir l'index (la position dans un groupe) d'un objet avec jQuery?
- JavaScript: Send function as a parameter to another function (callbacks) JavaScript: Envoyer fonction comme paramètre à une autre fonction (rappels)
- Ubuntu terminal: invalid host type && configure: error: can only configure for one host and one target at a time Administration Ubuntu: type d'hôte invalide & & configure: error: peut configurer seulement pour un accueil et une cible à la fois
- Jenny Jenny












































