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 | Email Get updates via feedburner Get updates via twitter
Home / Coding / PHP / PHP Error: Call to a member … Home / Coding / PHP / PHP Error: Tawag sa isang miyembro ng ...

PHP Error: Call to a member function fetch_assoc() on a non-object in PHP Error: Tawag sa isang miyembro fetch_assoc function () sa isang hindi-bagay sa

Posted on 23. Posted on 23. Jun, 2009 by Dragos in Coding , PHP Hunyo, 2009 sa pamamagitan ng Dragos sa 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. Kung makuha na ninyo ang error na ito: Tawag sa isang miyembro fetch_assoc function () sa isang hindi-bagay sa ..., ito ay nangangahulugan na ikaw ay may pagkakamali sa inyong MySQL syntax. Supposing that $mysqli is your database connection object, put echo $mysqli->error; just before the line you're getting the error on. Kaya na $ mysqli ay ang iyong object database ng koneksyon, ilagay echo $ mysqli-> error; lamang bago ang linya mo nakukuha ang error on.

 $mysqli=new mysqli(HOST,USER,PASS,DB); $ mysqli = bagong mysqli (HOST, GUMAGAMIT, PASS, DB); 
 $mQuery=$mysqli->query('select `data` from `this_table` where `id`=1'); $ mQuery = $ mysqli-> tanong ( 'piliin ang `ng data mula sa` `` this_table kung saan `` id = 1'); 
 echo $mysqli->error; //echoes that column `data` does not exist in table `this_table` echo $ mysqli-> error; / / dayandang na haligi `` data ay hindi na umiiral sa mesa `this_table` 
 $row=$mQuery->fetch_assoc(); //gives error as the column `data` is in table `that_table`, not in table `this_table` $ hilera = $ mQuery-> fetch_assoc (); / / error na nagbibigay ng hanay ng data sa `` ay nasa mesa `that_table`, hindi sa table `this_table` 
 $mysqli->close(); $ mysqli-> malapit (); 
Translate this post Isalin ang post na ito


Related posts: Related posts:

  1. Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: Madaling I-reset ang iyong Account Password Paggamit ng MySQL at PHP
  2. Coding:How to fetch user profile data with SSI.php from a SMF forum database Coding: Paano upang makuha ang data ng user profile na may SSI.php mula sa isang database ng SMF forum
  3. JavaScript: How to get the index (position within a group) of an object with jQuery? JavaScript: Paano upang makuha ang index (na posisyon sa loob ng isang grupo) ng isang bagay na may jQuery?
  4. JavaScript: Send function as a parameter to another function (callbacks) JavaScript: Ipadala ang function bilang isang parameter sa isa pang function (callbacks)
  5. Ubuntu terminal: invalid host type && configure: error: can only configure for one host and one target at a time Ubuntu terminal: invalid-host ng uri & & i-configure: error: Maaari lamang na i-configure para sa isang host at isa-target sa isang panahon

  • Jenny Dyeni
    Pretty nice post. Pretty nice post. I just found your site and wanted to say Ko na lang natagpuan ang iyong site at nais na sabihin
    that I've really enjoyed reading your blog posts. na talagang Nasiyahan ako sa pagbabasa sa iyong blog posts. Anyway Gayunpaman
    I'll be subscribing to your blog and I hope you write again soon! Kukunin ko na-subscribe sa iyong blog at pag-asa ko sumulat ka muli sa lalong madaling panahon!
blog comments powered by Disqus blog comments powered by Disqus