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 Actualizacións Via RSS | Email Get updates via feedburner Get updates via twitter
Home / Coding / PHP / PHP Error: Call to a member … Home / Codificación / PHP / PHP Error: Call to a member ...

PHP Error: Call to a member function fetch_assoc() on a non-object in PHP Error: Call to a member function fetch_assoc () sobre un obxecto non-in

Posted on 23. Posta en 23. Jun, 2009 by Dragos in Coding , PHP Xuño de 2009 por Dragos na Codificación, 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 recibe este erro: Chamada a un membro da función fetch_assoc () sobre un obxecto non-in ..., isto significa que ten un erro na súa sintaxe mysql. Supposing that $mysqli is your database connection object, put echo $mysqli->error; just before the line you're getting the error on. Supoñendo que $ mysqli é o seu obxecto de conexión de base de datos, coloque echo $ mysqli-> error; só antes da liña que está a recibir o erro.

$mysqli=new mysqli(HOST,USER,PASS,DB); $ Mysqli = new mysqli (HOST, USER, pasa, DB);
$mQuery=$mysqli->query('select `data` from `this_table` where `id`=1'); mQuery $ = $ mysqli-> query ( 'SELECT `data` de `this_table` where `id` = 1');
echo $mysqli->error; //echoes that column `data` does not exist in table `this_table` echo $ mysqli-> error; / ecos desa columna `data` non existe na táboa `` 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á erro como a columna `data` está na mesa »that_table», non na táboa `` this_table
$mysqli->close(); $ Mysqli-> close ();
Translate this post Traducir esta post


Related posts: Related posts:

  1. Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: facilmente axustar o teu contrasinal da conta utilizando MySQL e PHP
  2. Coding:How to fetch user profile data with SSI.php from a SMF forum database Coding: Como buscar datos de perfil de usuario con SSI.php dun banco de foro SMF
  3. JavaScript: How to get the index (position within a group) of an object with jQuery? JavaScript: Como obter o índice (posición dentro dun grupo) dun obxecto con jQuery?
  4. JavaScript: Send function as a parameter to another function (callbacks) JavaScript: Enviar funcionar como un parámetro para outra función (callbacks)
  5. Ubuntu terminal: invalid host type && configure: error: can only configure for one host and one target at a time Ubuntu terminal: tipo de servidor non válido & & configure: error: só pode configurar para un servidor e un obxecto de aprendizaxe de cada vez

  • Jenny Jenny
    Pretty nice post. Pretty nice post. I just found your site and wanted to say Eu atope o seu sitio e quería dicir
    that I've really enjoyed reading your blog posts. que eu realmente gosto de ler o seu blog. Anyway De calquera maneira
    I'll be subscribing to your blog and I hope you write again soon! Eu vou estar asinado o seu blog e espero que escribir de novo en breve!
blog comments powered by Disqus blog comments powered by Disqus