PHP Error: Call to a member function fetch_assoc() on a non-object in PHP Errore: Chiamata a una funzione membro fetch_assoc () su un non-oggetto in
Posted on 23. Posted on 23. Jun, 2009 by Dragos in Coding , PHP Giugno, 2009 da Dragos in 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. Se viene visualizzato questo errore: Call to un membro funzione fetch_assoc () su un non-oggetto in ..., significa che c'è un errore nel vostro sintassi mysql. Supposing that $mysqli is your database connection object, put echo $mysqli->error; just before the line you're getting the error on. Supponendo che $ mysqli è l'oggetto di connessione al database, messo echo $ mysqli-> error; appena prima della linea che stai ricevendo l'errore su.
$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'); $ mDomanda = $ mysqli-> query ( 'SELECT `dati` da `this_table` se `id` = 1'); echo $mysqli->error; //echoes that column `data` does not exist in table `this_table` echo $ mysqli-> error; / / echi che i dati «colonna» non esiste nella tabella `this_table` $row=$mQuery->fetch_assoc(); //gives error as the column `data` is in table `that_table`, not in table `this_table` $ row = $ mDomanda-> fetch_assoc (); / / dà errore come la colonna `dati` è in tabella `that_table`, non nella tabella `this_table` $mysqli->close(); $ mysqli-> close ();
Translate this post Traduci questo post
Related posts: Related posts:
- Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: Facilmente Reset Your Account password che utilizza MySQL e PHP
- Coding:How to fetch user profile data with SSI.php from a SMF forum database Coding: Come recuperare i dati del profilo utente con SSI.php da un database forum SMF
- JavaScript: How to get the index (position within a group) of an object with jQuery? JavaScript: Come ottenere l'indice (posizione all'interno di un gruppo) di un oggetto con jQuery?
- JavaScript: Send function as a parameter to another function (callbacks) JavaScript: Invia funzione come parametro a un'altra funzione (callback)
- Ubuntu terminal: invalid host type && configure: error: can only configure for one host and one target at a time Terminale di Ubuntu: tipo di host non valido & & configure: error: può configurare solo per un host e un obiettivo alla volta
- Jenny Jenny












































