Call to undefined method mysqli_stmt::get_result

后端 未结 10 976
难免孤独
难免孤独 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条回答
  •  旧时难觅i
    2020-11-21 05:18

    I know this was already answered as to what the actual problem is, however I want to offer a simple workaround.

    I wanted to use the get_results() method however I didn't have the driver, and I'm not somewhere I can get that added. So, before I called

    $stmt->bind_results($var1,$var2,$var3,$var4...etc);
    

    I created an empty array, and then just bound the results as keys in that array:

    $result = array();
    $stmt->bind_results($result['var1'],$result['var2'],$result['var3'],$result['var4']...etc);
    

    so that those results could easily be passed into methods or cast to an object for further use.

    Hope this helps anyone who's looking to do something similar.

提交回复
热议问题