This is a translated page. The original can be found here: http://iwebdevel.com/2009/06/23/php-error-call-to-a-member-function-fetch_assoc-on-a-non-object-in/
UPDATES VIA RSS | Email ACTUALITZACIONS VIA RSS | Email Get updates via feedburner Get updates via twitter
Home / Coding / PHP / PHP Error: Call to a member … Inici / codificació / PHP / PHP Error: Crida a un membre ...

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 (); 
Translate this post Demanar aquest missatge


Related posts: Llocs relacionats amb:

  1. Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: Fàcilment Restablir la contrasenya del compte Ús de MySQL i PHP
  2. 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
  3. 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?
  4. JavaScript: Send function as a parameter to another function (callbacks) JavaScript: Enviar funcionar com un paràmetre a una altra funció (callbacks)
  5. 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
    Pretty nice post. Post Molt bonic. I just found your site and wanted to say Acabo de trobar el seu lloc i volia dir
    that I've really enjoyed reading your blog posts. que he gaudit molt llegint el seu bloc. Anyway De totes maneres
    I'll be subscribing to your blog and I hope you write again soon! Estaré subscriguin al vostre bloc i espero que escriure de nou aviat!
blog comments powered by Disqus blog alimentat per Disqus