$result = mysql_query("SELECT * FROM Persons");
while($row = mysql_fetch_array($result))
{
echo $row['FirstName'];
echo $row['LastName'];
}
我想要一个 $i ++ 所以我得到 1 然后 2 依此类推,所以我可以这样:
$result = mysql_query("SELECT * FROM Persons");
while($row = mysql_fetch_array($result))
{
if($i == 1){
<div>
echo $row['FirstName'];
echo $row['LastName'];
</div>
}
elseif($i == 2){
echo $row['FirstName'];
echo $row['LastName'];
}