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 ();
Related posts: Related posts:
- Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: facilmente axustar o teu contrasinal da conta utilizando MySQL e PHP
- 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
- 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?
- JavaScript: Send function as a parameter to another function (callbacks) JavaScript: Enviar funcionar como un parámetro para outra función (callbacks)
- 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












































