PHP Error: Call to a member function fetch_assoc() on a non-object in PHP的错误:调用一个成员函数fetch_assoc()在一个非对象
Posted on 23.发布23。 Jun, 2009 by Dragos in Coding , PHP 2008年6月,2009年在编码 ,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.如果您收到此错误:调用一个成员函数fetch_assoc()在一个非对象...,这意味着你已经在你的MySQL语法错误。 Supposing that $mysqli is your database connection object, put echo $mysqli->error; just before the line you're getting the error on.假定$库MySQLi是你的数据库连接对象,把回声$库MySQLi,“误差;行前夕,你得到的错误。
$mysqli=new mysqli(HOST,USER,PASS,DB); $库MySQLi =(主机,用户,密码,DB)的新库MySQLi; $mQuery=$mysqli->query('select `data` from `this_table` where `id`=1'); $ mQuery = $库MySQLi,“查询('选择'从数据```this_table那些`号`= 1'); echo $mysqli->error; //echoes that column `data` does not exist in table `this_table`回声$库MySQLi,“误差; / /显示该列``数据中不存在的表`this_table` $row=$mQuery->fetch_assoc(); //gives error as the column `data` is in table `that_table`, not in table `this_table` $行= $ mQuery,“fetch_assoc(); / /给作为列数据错误``表是``,而不是在表that_table`this_table` $mysqli->close(); $库MySQLi -“的close();
Translate this post翻译这个职位
Related posts:相关岗位:
- Wordpress: Easily Reset Your Account Password Using MySQL and PHP WordPress的:轻松重置您的帐户密码使用MySQL和PHP
- Coding:How to fetch user profile data with SSI.php from a SMF forum database 编码:如何获取从证券保证金融资论坛数据库SSI.php用户配置文件数据
- JavaScript: How to get the index (position within a group) of an object with jQuery? JavaScript的:如何获取指数(位置在一组与jQuery对象)?
- JavaScript: Send function as a parameter to another function (callbacks) JavaScript的:寄另一个函数(回调参数功能)
- Ubuntu terminal: invalid host type && configure: error: can only configure for one host and one target at a time Ubuntu的终端:无效的主机类型&&配置:错误:只配置一台主机和一个针对一时间
- Jenny 珍妮












































