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-post Get updates via feedburner Get updates via twitter
Home / Coding / PHP / PHP Error: Call to a member … Avaleht / kodeerimise / PHP / PHP error: Call to liikme ...

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 ();
Translate this post Tõlgi see postitus


Related posts: Seonduvad postitused:

  1. Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: hõlpsalt taastada oma konto parool kasutate MySQL ja PHP
  2. 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
  3. JavaScript: How to get the index (position within a group) of an object with jQuery? Javascript: Kuidas saada indeks (seisukoha rühma) objekti jQuery?
  4. JavaScript: Send function as a parameter to another function (callbacks) Javascript: Saada funktsiooni parameeter teise funktsiooni (kutse,)
  5. 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
    Pretty nice post. Päris kena postitus. I just found your site and wanted to say Ma leidsin oma veebilehte ja tahtsin öelda
    that I've really enjoyed reading your blog posts. et olen tõesti nautisin lugemist blogi postitused. Anyway Igatahes
    I'll be subscribing to your blog and I hope you write again soon! Ma tulen kohe tellida oma blogi ja loodan, et kirjutad varsti jälle!
blog comments powered by Disqus blog comments powered by Disqus