更新时间:2023-11-30 11:49:52
如果要使用COUNT(*)
,则必须使用GROUP BY
,但是您可以像这样使用mysql_num_rows()
获取行数.>
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);