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

后端 未结 5 2013
北恋
北恋 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:29

    If you user & password field text or varchar, then you need to use single quote around them

    $query = "SELECT user, password FROM Users WHERE user = '".$user."' AND password = '".$pass."' " ;
    

提交回复
热议问题