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 Atnaujinimai Via RSS | E-mail Get updates via feedburner Get updates via twitter
Home / Coding / PHP / PHP Error: Call to a member … Pagrindinis / Kodai / PHP / PHP error: Call to a member ...

PHP Error: Call to a member function fetch_assoc() on a non-object in PHP error: Call to a member funkcija fetch_assoc () dėl ne daiktas

Posted on 23. Posted on 23. Jun, 2009 by Dragos in Coding , PHP Birželis, 2009 Dragos ir kodavimo, 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. Jei gaunate šį klaidos: Call to a member funkcija fetch_assoc () dėl ne daiktas ..., tai reiškia, kad turite savo mysql sintaksės klaida. Supposing that $mysqli is your database connection object, put echo $mysqli->error; just before the line you're getting the error on. Darant prielaidą, kad $ mysqli Jūsų ryšį su duomenų baze objektas, įdėti echo $ mysqli-> klaida; prieš linija gaunate klaidą.

 $mysqli=new mysqli(HOST,USER,PASS,DB); $ mysqli = nauji mysqli (host, VARTOTOJUI, PASS, DB); 
 $mQuery=$mysqli->query('select `data` from `this_table` where `id`=1'); $ mQuery = $ mysqli-> query ( "select` duomenys `nuo` this_table `kur` id `= 1"); 
 echo $mysqli->error; //echoes that column `data` does not exist in table `this_table` echo $ mysqli-> error / / aidų, kad skiltyje "duomenys" neegzistuoja lentelėje "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 (); / / duoda klaidą skiltyje "duomenys" yra lentelėje "that_table", o ne lentele "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: lengvai pakeisti slaptažodį sąskaitos naudojant MySQL ir PHP
  2. Coding:How to fetch user profile data with SSI.php from a SMF forum database Kodai: Kaip įkelti naudotojo profilį duomenų SSI.php iš SMF forumas duomenų
  3. JavaScript: How to get the index (position within a group) of an object with jQuery? JavaScript: Kaip gauti indeksą (pozicijos grupės) su jQuery objektas?
  4. JavaScript: Send function as a parameter to another function (callbacks) JavaScript: Siųsti funkcija kaip parametro kitos funkcijos (Atgalinės iššūkius)
  5. Ubuntu terminal: invalid host type && configure: error: can only configure for one host and one target at a time Ubuntu terminalas: Invalid tipas kompiuterio & & Configure: error: galite konfigūruoti tik vieną priimančiosios ir vieno tikslo ne laiku

  • Jenny Jenny
    Pretty nice post. Pretty nice post. I just found your site and wanted to say Aš ką tik randa jūsų svetainę ir norėjau pasakyti
    that I've really enjoyed reading your blog posts. kad aš tikrai patiko skaityti jūsų dienoraščio. Anyway Bet kuriuo atveju
    I'll be subscribing to your blog and I hope you write again soon! I'll be Įrašymas į savo dienoraštį ir aš tikiuosi, kad jūs rašyti dar greičiau!
blog comments powered by Disqus Dienoraštis komentarus maitina Disqus