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 ();
Related posts: Related posts:
- Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: Madaling I-reset ang iyong Account Password Paggamit ng MySQL at PHP
- 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
- 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?
- JavaScript: Send function as a parameter to another function (callbacks) JavaScript: Ipadala ang function bilang isang parameter sa isa pang function (callbacks)
- 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












































