PHP Error: Call to a member function fetch_assoc() on a non-object in PHP error: Call to jäsenen toiminnon fetch_assoc () ei-objektin
Posted on 23. Postitettu 23. Jun, 2009 by Dragos in Coding , PHP Kesäkuu, 2009 Dragos vuonna 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. Jos saat tämän virheilmoituksen: Call to jäsenen toiminnon fetch_assoc () ei-esine ..., se tarkoittaa, että sinulla on virhe MySQL syntaksia. Supposing that $mysqli is your database connection object, put echo $mysqli->error; just before the line you're getting the error on. Olettaen, että $ mysqli on tietokanta yhteyden kohteen, laittaa echo $ mysqli-> error, juuri ennen linja saat virhe.
$mysqli=new mysqli(HOST,USER,PASS,DB); $ mysqli = uusi mysqli (host, user, PASS, DB); $mQuery=$mysqli->query('select `data` from `this_table` where `id`=1'); $ mQuery = $ mysqli-> query ( "Valitse" tiedot "alkaen` this_table "Jos` id `= 1 '); echo $mysqli->error; //echoes that column `data` does not exist in table `this_table` echo $ mysqli-> error; / / kaiut sarakkeen "tietoa" ei ole taulukossa `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 () / / antaa virhe sarakkeessa "tiedot" on taulukossa "that_table", ei taulukossa `this_table" $mysqli->close(); $ mysqli-> Close ();
Related posts: Liittyvien virkojen:
- Wordpress: Easily Reset Your Account Password Using MySQL and PHP WordPress: helposti palauttaa tilisi salasanan MySQL ja PHP
- Coding:How to fetch user profile data with SSI.php from a SMF forum database Koodaus: Miten hakea käyttäjäprofiilin tietojen SSI.php peräisin SMF foorumin tietokanta
- JavaScript: How to get the index (position within a group) of an object with jQuery? JavaScript: Miten saada indeksi (asema ryhmä) objektin kanssa jQuery?
- JavaScript: Send function as a parameter to another function (callbacks) JavaScript: Lähetä toimivat parametri toisen toiminnon (kutsuja)
- Ubuntu terminal: invalid host type && configure: error: can only configure for one host and one target at a time Ubuntu terminaali: Virheellinen palvelimen tyyppi & & configure: error: vain määrittää yksi isäntä ja yksi kohde kerrallaan












































