相关疑难解决方法(0)

调用未定义的方法mysqli_stmt :: get_result

这是我的代码:

include 'conn.php';
$conn = new Connection();
$query = 'SELECT EmailVerified, Blocked FROM users WHERE Email = ? AND SLA = ? AND `Password` = ?';
$stmt = $conn->mysqli->prepare($query);
$stmt->bind_param('sss', $_POST['EmailID'], $_POST['SLA'], $_POST['Password']);
$stmt->execute();
$result = $stmt->get_result();
Run Code Online (Sandbox Code Playgroud)

我在最后一行得到错误:调用未定义的方法mysqli_stmt :: get_result()

这是conn.php的代码:

define('SERVER', 'localhost');
define('USER', 'root');
define('PASS', 'xxxx');
define('DB', 'xxxx');
class Connection{
    /**
     * @var Resource 
     */
    var $mysqli = null;

    function __construct(){
        try{
            if(!$this->mysqli){
                $this->mysqli = new MySQLi(SERVER, USER, PASS, DB);
                if(!$this->mysqli)
                    throw new Exception('Could not create connection using …
Run Code Online (Sandbox Code Playgroud)

php mysqli

107
推荐指数
9
解决办法
12万
查看次数

标签 统计

mysqli ×1

php ×1