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 Uppdateringar via RSS | E-post Get updates via feedburner Get updates via twitter
Home / Coding / PHP / PHP Error: Call to a member … Hem / Kodning / PHP / PHP fel: Kalla till en medlem ...

PHP Error: Call to a member function fetch_assoc() on a non-object in PHP fel: Kalla till en medlem funktion fetch_assoc () på icke-objekt i

Posted on 23. Posted on 23. Jun, 2009 by Dragos in Coding , PHP Juni, 2009 av Dragos i 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. Om du får detta fel: Kalla till en medlem funktion fetch_assoc () på icke-objekt i ... betyder det att du har ett fel i din mysql syntax. Supposing that $mysqli is your database connection object, put echo $mysqli->error; just before the line you're getting the error on. Anta att $ mysqli är din databas anslutningen objekt, lägga echo $ mysqli-> fel, precis innan linjen att du får det fel.

 $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 ( "väljer du" data "från` this_table `där` id `= 1 '); 
 echo $mysqli->error; //echoes that column `data` does not exist in table `this_table` echo $ mysqli-> error; / / ekon kolumnen "uppgifter" inte finns i tabellen "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 () / / ger fel som kolumnen "uppgifter" är i tabell `that_table", inte i tabell `this_table` 
 $mysqli->close(); $ mysqli-> close (); 
Translate this post Översätta det här inlägget


Related posts: Relaterade tjänster:

  1. Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: enkelt återställa lösenordet för ditt konto med MySQL och PHP
  2. Coding:How to fetch user profile data with SSI.php from a SMF forum database Coding: Hur hämta data användarprofil med SSI.php från SMF forum databas
  3. JavaScript: How to get the index (position within a group) of an object with jQuery? JavaScript: Hur man får indexet (position inom en grupp) för ett objekt med jQuery?
  4. JavaScript: Send function as a parameter to another function (callbacks) JavaScript: Skicka fungera som en parameter till en annan funktion (callbacks)
  5. Ubuntu terminal: invalid host type && configure: error: can only configure for one host and one target at a time Ubuntu terminal: ogiltig värdtyp & & configure: error: kan bara konfigurera för ett mottagande och ett mål i taget

  • Jenny Jenny
    Pretty nice post. Pretty nice post. I just found your site and wanted to say Jag hittade din webbplats och ville säga
    that I've really enjoyed reading your blog posts. att jag verkligen tyckte om att läsa dina blogginlägg. Anyway I alla fall
    I'll be subscribing to your blog and I hope you write again soon! Jag kommer att prenumerera på din blogg och jag hoppas du skriver snart igen!
blog comments powered by Disqus blogg kommentarer drivs av Disqus