我的 while 循环跳过该元素。寻找类似的问题,但仍然无法理解。请赐教。天呐!
$query = "SELECT userid, COUNT(content) as x_count
FROM x GROUP BY userid ORDER BY x_count DESC
LIMIT 5";
$result = mysql_query($query) or die("Error in query:".mysql_error());
$row = mysql_fetch_assoc($result);
echo '<br>';
while(list($id,$no_x) = mysql_fetch_array($result)){
echo $id.'number of x:'.$no_x;
echo '<br>';
}