fail execute statement with php and mysql

后端 未结 1 1451
醉话见心
醉话见心 2021-01-29 08:10

I insert the users output like this:

  $userName= SanitizeString($userName);
  $pass= SanitizeString($pass);
  $email= SanitizeString($email);

  $userName=mysql         


        
1条回答
  •  孤独总比滥情好
    2021-01-29 08:38

    You have to use GROUP BY if you want to use COUNT(*), but you can get the number of rows with mysql_num_rows() like this.

    $result=mysql_query("SELECT * AS Result FROM users WHERE user_name='$user_name' AND pass='$password_hash' LIMIT 1") or die(mysql_error());
    $num_rows = mysql_num_rows($result);
    

    0 讨论(0)
提交回复
热议问题