This is a translated page. The original can be found here: http://iwebdevel.com/2009/06/23/php-error-call-to-a-member-function-fetch_assoc-on-a-non-object-in/
UPDATES VIA RSS | Email MISES A JOUR VIA RSS | Email Get updates via feedburner Get updates via twitter
Home / Coding / PHP / PHP Error: Call to a member … Accueil / Codage / PHP / PHP Error: Appel à un membre ...

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 (); 
Translate this post Translate this post


Related posts: Related posts:

  1. Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: Reset Facilement passe de votre compte avec MySQL et PHP
  2. 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
  3. 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?
  4. JavaScript: Send function as a parameter to another function (callbacks) JavaScript: Envoyer fonction comme paramètre à une autre fonction (rappels)
  5. 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
    Pretty nice post. Pretty nice post. I just found your site and wanted to say Je viens de découvrir votre site et je voulais dire
    that I've really enjoyed reading your blog posts. que j'ai vraiment apprécié la lecture de vos messages blog. Anyway De toute manière
    I'll be subscribing to your blog and I hope you write again soon! Je vais être abonnés à votre blog et j'espère que vous écrire de nouveau bientôt!
blog comments powered by Disqus Commentaires Blog powered by Disqus