在我的本地/开发环境中,MySQLi查询运行正常。然而,当我将其上传到我的Web主机环境时,出现以下错误:
Fatal error: Call to a member function bind_param() on a non-object in...
这是代码:
global $mysqli;
$stmt = $mysqli->prepare("SELECT id, description FROM tbl_page_answer_category WHERE cur_own_id = ?");
$stmt->bind_param('i', $cur_id);
$stmt->execute();
$stmt->bind_result($uid, $desc);
为了检查我的查询,我尝试通过控制面板的phpMyAdmin执行查询,结果是正常的。
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号