PHP Error: Call to a member function fetch_assoc() on a non-object in PHP error: Call to liikme funktsiooni fetch_assoc () kedagi objekti
Posted on 23. Postitatud 23. Jun, 2009 by Dragos in Coding , PHP Juuni, 2009 Dragos in kodeerimise, 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. Kui sa selle error: Call to liikme funktsiooni fetch_assoc () on mitte-objekt ... tähendab see, et sul on viga Teie MySQL süntaks. Supposing that $mysqli is your database connection object, put echo $mysqli->error; just before the line you're getting the error on. Eeldades, et $ mysqli on oma andmebaasi ühenduse objekti, pane echo $ mysqli-> vigu; vahetult enne joont te saate viga.
$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 ( "valige" andmed "alates" this_table "kui" id "= 1 '); echo $mysqli->error; //echoes that column `data` does not exist in table `this_table` echo $ mysqli-> vigu; / / kordab, et veerus "andmed" ei eksisteeri tabelis "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 (); / / annab vea, kui veerus "andmetel" on tabelis "that_table", ei ole tabelis "this_table" $mysqli->close(); $ mysqli-> close ();
Related posts: Seonduvad postitused:
- Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: hõlpsalt taastada oma konto parool kasutate MySQL ja PHP
- Coding:How to fetch user profile data with SSI.php from a SMF forum database Kood: Kuidas tõmmata kasutajaprofiili andmete SSI.php alates SMF foorumi andmebaas
- JavaScript: How to get the index (position within a group) of an object with jQuery? Javascript: Kuidas saada indeks (seisukoha rühma) objekti jQuery?
- JavaScript: Send function as a parameter to another function (callbacks) Javascript: Saada funktsiooni parameeter teise funktsiooni (kutse,)
- Ubuntu terminal: invalid host type && configure: error: can only configure for one host and one target at a time Ubuntu terminali: vale vastuvõtva liik & configure: error: saab seadistada ühe vastuvõtva ja ühe sihtmärgi korda
- Jenny Jenny












































