I'm a little confused, PHP says $results is a non-object of the mysqli class

后端 未结 5 1998
北恋
北恋 2020-12-22 13:01

I\'m trying to fetch results using mysqli->fetch_row() (or fetch_object(), fetch_array()), yet when I go to run the code at run time it gives me the following error:

5条回答
  •  天涯浪人
    2020-12-22 13:16

    You have to check, if query runs properly:

    if ($result = $mysqli->query($query))
    {
    }
    

    Use: var_dump($results) to check what it contains

提交回复
热议问题