PHP Error: Call to a member function fetch_assoc() on a non-object in PHP Error: Call to locekļa funkciju fetch_assoc () par bez objekts
Posted on 23. Posted on 23. Jun, 2009 by Dragos in Coding , PHP Jun, 2009 by Dragos in kodēšanas, 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. Ja jums tas error: Call to locekļa funkciju fetch_assoc () par bez objektu ... tas nozīmē, ka jums ir kļūda jūsu mysql sintaksi. Supposing that $mysqli is your database connection object, put echo $mysqli->error; just before the line you're getting the error on. Pieņemot, ka $ mysqli ir jūsu datu bāzes savienojuma objektu nodot echo $ mysqli-> error, vienkārši pirms līniju saņemat kļū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 ( "izvēlieties" datu `no` this_table `ja` id `= 1 '); echo $mysqli->error; //echoes that column `data` does not exist in table `this_table` echo $ mysqli-> error; / / atbalsis, ka kolonna "dati" neeksistē tabulā `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 (); / / dod kļūdu kolonna "dati" ir tabula `that_table", nevis tabulā `this_table` $mysqli->close(); $ mysqli-> Close ();
Related posts: Related posts:
- Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: Viegli Reset Your account password Ar MySQL un PHP
- PHP: How to download a webpage (aka web scrapping) with PHP PHP: Kā lejupielādēt tīmekļa vietnē (pazīstams arī kā web metāllūžņos) ar PHP
- Coding:How to fetch user profile data with SSI.php from a SMF forum database Coding: Kā ielādēt lietotāja profila datus ar SSI.php no SMF foruma datubāze
- JavaScript: How to get the index (position within a group) of an object with jQuery? JavaScript: Kā nokļūt indekss (amatu grupā) un objekts ar jQuery?
- JavaScript: Send function as a parameter to another function (callbacks) JavaScript: Sūtīt funkcija kā parametru citai funkcijai (callbacks)
- Jenny Jenny












































