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 ();
Related posts: Related posts:
- Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: facilmente redefinir sua senha da conta usando MySQL e PHP
- 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
- 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?
- JavaScript: Send function as a parameter to another function (callbacks) JavaScript: Enviar funcionar como um parâmetro para outra função (callbacks)
- 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












































