Fatal error: Call to a member function bind_param() on a non-object in

今天在练习 mysql是出现错误:   Fatal error: Call to a member function bind_param() on a non-object in

解决步骤: 1. 找到错误代码: $stmt=$this->mysqli->prepare($query);//预处理语句

               2. 查看代码,里面就一个可能出错的地方:$query, 找到SQL语句

                  $query="update product set name = ?,price=?,description=?where productId=?";

                  仔细查看该语句,哦,恍然大悟,?where之间没有空格,聪明的你看出来了吗?

解决方案: SQL语句出错,查看SQl语句。关键字,表名,列名……

原文地址:https://www.cnblogs.com/Theladyflower/p/3245893.html