我有这个旧的 mysql 查询:
$sql = mysql_query("SELECT id FROM nf_users
WHERE points >
(SELECT points FROM nf_users WHERE id = 1)
AND played > 0");
$row = mysql_fetch_array($sql);
$rank = mysql_num_rows($sql)+1;
这给出了$rank
的值2578
。现在,如果我尝试像这样对 mysqli 做同样的事情:
$sql = mysqli_query($connect,"SELECT id FROM nf_users
WHERE points >
(SELECT points FROM nf_users WHERE id = 1)
AND played > 0");
$row = mysqli_fetch_array($sql);
$rank = mysqli_num_rows($sql)+1;
现在$rank
只说1
?
我究竟做错了什么?
请提前帮助和感谢:-)