Call to undefined method mysqli_stmt::get_result

后端 未结 10 970
难免孤独
难免孤独 2020-11-21 05:10

Here\'s my code:

include \'conn.php\';
$conn = new Connection();
$query = \'SELECT EmailVerified, Blocked FROM users WHERE Email = ? AND SLA = ? AND `Passwo         


        
10条回答
  •  青春惊慌失措
    2020-11-21 05:42

    So if the MySQL Native Driver (mysqlnd) driver is not available, and therefore using bind_result and fetch instead of get_result, the code becomes:

    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();
    $stmt->bind_result($EmailVerified, $Blocked);
    while ($stmt->fetch())
    {
       /* Use $EmailVerified and $Blocked */
    }
    $stmt->close();
    $conn->mysqli->close();
    

提交回复
热议问题