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 Atualizações Via RSS | Email Get updates via feedburner Get updates via twitter
Home / Coding / PHP / PHP Error: Call to a member … Home / Codificação / 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 um objeto não-in

Posted on 23. Postado em 23. Jun, 2009 by Dragos in Coding , PHP Junho de 2009 por Dragos na Codificação, 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 você receber este erro: Chamada a um membro da função fetch_assoc () sobre um objeto não-in ..., isso significa que você tem um erro em sua sintaxe mysql. Supposing that $mysqli is your database connection object, put echo $mysqli->error; just before the line you're getting the error on. Supondo que $ mysqli é seu objeto de conexão de banco de dados, coloque echo $ mysqli-> error; apenas antes da linha que você está recebendo o erro.

 $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 `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 dessa coluna `data` não existe na tabela `` 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 coluna `data` está na mesa »that_table», não na tabela `` this_table 
 $mysqli->close(); $ mysqli-> close (); 
Translate this post Traduzir este post


Related posts: Related posts:

  1. Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: facilmente redefinir sua senha da conta usando MySQL e PHP
  2. Coding:How to fetch user profile data with SSI.php from a SMF forum database Coding: Como buscar dados de perfil de usuário com SSI.php de um banco de fórum SMF
  3. JavaScript: How to get the index (position within a group) of an object with jQuery? JavaScript: Como obter o índice (posição dentro de um grupo) de um objeto com jQuery?
  4. JavaScript: Send function as a parameter to another function (callbacks) JavaScript: Enviar funcionar como um parâmetro para outra função (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 host inválido & & configure: error: só pode configurar para um host e um alvo de cada vez

  • Jenny Jenny
    Pretty nice post. Pretty nice post. I just found your site and wanted to say Eu encontrei seu site e queria dizer
    that I've really enjoyed reading your blog posts. que eu realmente gostei de ler o seu blog. Anyway De qualquer maneira
    I'll be subscribing to your blog and I hope you write again soon! Eu vou estar assinando o seu blog e espero que escrever novamente em breve!
blog comments powered by Disqus blog comentários powered by Disqus