我有一个看起来像这样的 MySQL 表 -
当我尝试使用以下代码打印所有行时
<?php
include_once("connect.php");
$sql = "SELECT * FROM scores";
$query = mysql_query($sql) or die("systemResult=Error");
$counter = mysql_num_rows($query);
if($counter>0)
{
print("systemResult=Success<br>");
while($data=mysql_fetch_array($query))
{
$athleteName = $data["athleteName"];
print "&athleteName=" . $athleteName;
print "<br>";
}
}
else
{
print("systemResult=Error");
}
?>
代码的精确副本 - http://pastebin.com/00WFdnrt
我得到以下输出
systemResult=Success
&athleteName=Guest-73
&athleteName=Guest-71
&athleteName=Guest-24
&athleteName=Guest-67
&athleteName=Guest-37
&athleteName=Guest-23
&athleteName=Guest-91
&athleteName=ankur
&athleteName=Guest-41
&athleteName=Guest-38
&athleteName=Guest-72
&athleteName=Guest-25
&athleteName=Guest-36
&athleteName=Guest-17
如您所见,第一行 (id:1, atheleteName:ankur) 没有被打印。我在这里做错了什么?