PHP Error: Call to a member function fetch_assoc() on a non-object in PHP Error: Crida a una funció membre fetch_assoc () en un objecte no en
Posted on 23. Publicat a 23. Jun, 2009 by Dragos in Coding , PHP Juny de 2009, per Dragos a la codificació, 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. Si rebeu aquest error: Crida a un membre de la funció fetch_assoc () en un objecte no a ..., vol dir que vostè té un error en la sintaxi de MySQL. Supposing that $mysqli is your database connection object, put echo $mysqli->error; just before the line you're getting the error on. Suposant que $ mysqli és el seu objecte de connexió de bases de dades, posar echo $ mysqli-> error; just abans de la línia que vostè està rebent l'error.
$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 ( "SELECT` dades `de` `this_table on` id `= 1 '); echo $mysqli->error; //echoes that column `data` does not exist in table `this_table` echo $ mysqli-> error; / / es fa ressò que les dades de la columna `no existeix a la taula` 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 (); / / dóna error a la columna de «dades», es troba a la taula `that_table", no a la taula `this_table» $mysqli->close(); $ Mysqli-> Close ();
Related posts: Llocs relacionats amb:
- Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: Fàcilment Restablir la contrasenya del compte Ús de MySQL i PHP
- Coding:How to fetch user profile data with SSI.php from a SMF forum database Codificació: Com buscar dades de perfils d'usuari amb SSI.php d'una base de dades de fòrum SMF
- JavaScript: How to get the index (position within a group) of an object with jQuery? JavaScript: Com obtenir l'índex (posició dins d'un grup) d'un objecte amb jQuery?
- JavaScript: Send function as a parameter to another function (callbacks) JavaScript: Enviar funcionar com un paràmetre a una altra funció (callbacks)
- Ubuntu terminal: invalid host type && configure: error: can only configure for one host and one target at a time Terminal d'Ubuntu: tipus de host no vàlid & & configure: error: només pot configurar per a un amfitrió i un objectiu a la vegada
- Jenny Jenny












































