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 Aktualizacje pocztą RSS | Email Get updates via feedburner Get updates via twitter
Home / Coding / PHP / PHP Error: Call to a member … Strona główna / Coding / 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 function fetch_assoc () w dniu wolnym od obiektu

Posted on 23. Zamieszczone w dniu 23. Jun, 2009 by Dragos in Coding , PHP Cze, 2009 Dragos w 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. Jeśli ten błąd: Call to a member function fetch_assoc () w dniu wolnym od obiektu ..., to znaczy, że masz błąd w składni MySQL. Supposing that $mysqli is your database connection object, put echo $mysqli->error; just before the line you're getting the error on. Przypuśćmy, że $ mysqli jest twój obiekt połączenia z bazą danych, pakowane echo $ mysqli-> error; tuż przed linią you're getting błędu.

 $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 ( "SELECT` dane `z` this_table `WHERE` id `= 1 '); 
 echo $mysqli->error; //echoes that column `data` does not exist in table `this_table` echo $ mysqli-> error; / / wyświetla kolumny "dane" nie istnieje w tabeli "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 () / / daje błąd w kolumnie "dane" jest w tabeli "that_table", a nie w tabeli "this_table" 
 $mysqli->close(); $ mysqli-> close (); 
Translate this post Translate this post


Related posts: Podobne posty:

  1. Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: łatwo zresetować Twoje konto Hasło MySQL i PHP
  2. Coding:How to fetch user profile data with SSI.php from a SMF forum database Kodowanie: Jak pobrać dane z profilu użytkownika SSI.php z bazy danych SMF forum
  3. JavaScript: How to get the index (position within a group) of an object with jQuery? JavaScript: Jak zdobyć indeks (pozycja w grupie) obiektu z jQuery?
  4. JavaScript: Send function as a parameter to another function (callbacks) JavaScript: Wyślij funkcji jako parametr do innej funkcji (callback)
  5. Ubuntu terminal: invalid host type && configure: error: can only configure for one host and one target at a time Terminal Ubuntu: invalid host type & & configure: error: można skonfigurować tylko dla jednego hosta i jeden cel w czasie

    blog comments powered by Disqus blog komentarze powered by Disqus