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 ();
Related posts: Gerelateerde berichten:
- Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: Gemakkelijk Reset Uw account wachtwoord in met MySQL en PHP
- 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
- 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?
- JavaScript: Send function as a parameter to another function (callbacks) JavaScript: Stuur functie als parameter aan een andere functie (callbacks)
- 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












































