mysql_num_rows() expects parameter 1 to be resource, string given in

后端 未结 5 1772
说谎
说谎 2021-01-23 14:13

I have read through many other threads about this exact problem, but i for some reason can not solve my problem. Really need some help.

if (!$username||!$passwo         


        
5条回答
  •  长情又很酷
    2021-01-23 14:45

    Change:

    $check = mysql_query("SELECT * FROM Test WHERE username = '$username'");
    

    to

    $check = mysql_query("SELECT * FROM Test WHERE username = '$username'") or die(mysql_error());
    

    And you will see any potential errors that happens in the query.

    Also, I would highly recomend using either PDO or Mysqli instead of mysql functions, as they are deprecated and will be removed in future php versions.

提交回复
热议问题