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

后端 未结 5 1811
说谎
说谎 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:25

    First You make sure that connection established correctly to the database.

    Instead of writing query directly in

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

    Store the query in variable as

    $query = "SELECT * FROM Test WHERE username = '".$username."'";
    

    and execute it as

    $check = mysql_query($query);
    

    if you are still facing the issue,

    echo the query as

    echo $query;
    

    and execute the query directly in phpmyadmin and you can find the issue.

    I hope this helps.

提交回复
热议问题