PHP Error: Call to a member function fetch_assoc() on a non-object in PHP fel: Kalla till en medlem funktion fetch_assoc () på icke-objekt i
Posted on 23. Posted on 23. Jun, 2009 by Dragos in Coding , PHP Juni, 2009 av Dragos i 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. Om du får detta fel: Kalla till en medlem funktion fetch_assoc () på icke-objekt i ... betyder det att du har ett fel i din mysql syntax. Supposing that $mysqli is your database connection object, put echo $mysqli->error; just before the line you're getting the error on. Anta att $ mysqli är din databas anslutningen objekt, lägga echo $ mysqli-> fel, precis innan linjen att du får det fel.
$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 ( "väljer du" data "från` this_table `där` id `= 1 '); echo $mysqli->error; //echoes that column `data` does not exist in table `this_table` echo $ mysqli-> error; / / ekon kolumnen "uppgifter" inte finns i tabellen "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 () / / ger fel som kolumnen "uppgifter" är i tabell `that_table", inte i tabell `this_table` $mysqli->close(); $ mysqli-> close ();
Related posts: Relaterade tjänster:
- Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: enkelt återställa lösenordet för ditt konto med MySQL och PHP
- Coding:How to fetch user profile data with SSI.php from a SMF forum database Coding: Hur hämta data användarprofil med SSI.php från SMF forum databas
- JavaScript: How to get the index (position within a group) of an object with jQuery? JavaScript: Hur man får indexet (position inom en grupp) för ett objekt med jQuery?
- JavaScript: Send function as a parameter to another function (callbacks) JavaScript: Skicka fungera som en parameter till en annan funktion (callbacks)
- Ubuntu terminal: invalid host type && configure: error: can only configure for one host and one target at a time Ubuntu terminal: ogiltig värdtyp & & configure: error: kan bara konfigurera för ett mottagande och ett mål i taget
- Jenny Jenny












































