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 UPDATES VIA RSS | E-mail Get updates via feedburner Get updates via twitter
Home / Coding / PHP / PHP Error: Call to a member … Home / Coding / PHP / PHP Fout: Call to a member ...

PHP Error: Call to a member function fetch_assoc() on a non-object in PHP error: Call to a member function fetch_assoc () op een niet-object in

Posted on 23. Geplaatst op 23. Jun, 2009 by Dragos in Coding , PHP Juni, 2009 door Dragos in Coding, 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. Als je deze foutmelding krijgen: Call to a member function fetch_assoc () op een niet-object in ..., betekent dit dat u een fout in uw MySQL syntax. Supposing that $mysqli is your database connection object, put echo $mysqli->error; just before the line you're getting the error on. Stel dat $ mysqli is uw database connectie object, zet echo $ mysqli-> error; net voor de lijn je krijgt de foutmelding op.

 $mysqli=new mysqli(HOST,USER,PASS,DB); $ mysqli = new mysqli (gastheer, gebruiker, PASS, DB); 
 $mQuery=$mysqli->query('select `data` from `this_table` where `id`=1'); $ mQuery = $ mysqli-> query ( "select" gegevens "van` this_table `WHERE` id `= 1 '); 
 echo $mysqli->error; //echoes that column `data` does not exist in table `this_table` echo $ mysqli-> error; / / echo's die kolom "gegevens" niet bestaat in tabel `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 (); / / geeft fout als de kolom "gegevens" is in tabel `that_table", niet in de tabel `this_table` 
 $mysqli->close(); $ mysql-> Close (); 
Translate this post Translate this post


Related posts: Gerelateerde berichten:

  1. Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: Gemakkelijk Reset Uw account wachtwoord in met MySQL en PHP
  2. Coding:How to fetch user profile data with SSI.php from a SMF forum database Coding: Hoe te halen gebruikersprofiel gegevens met SSI.php uit een SMF forum database
  3. JavaScript: How to get the index (position within a group) of an object with jQuery? JavaScript: Hoe krijg ik de index (positie binnen een groep) van een object met jQuery?
  4. JavaScript: Send function as a parameter to another function (callbacks) JavaScript: Stuur functie als parameter aan een andere functie (callbacks)
  5. Ubuntu terminal: invalid host type && configure: error: can only configure for one host and one target at a time Ubuntu terminal: ongeldig host type & & configure: error: kan alleen configureren voor een host en een doel op een moment

  • Jenny Jenny
    Pretty nice post. Pretty Nice post. I just found your site and wanted to say Ik vond uw site en wilde zeggen
    that I've really enjoyed reading your blog posts. dat ik echt heb genoten van het lezen van uw blog posten. Anyway Hoe dan ook
    I'll be subscribing to your blog and I hope you write again soon! Ik zal abonneren op uw blog en ik hoop dat je snel weer schrijven!
blog comments powered by Disqus blog comments powered by Disqus