我的$num_rows输出的是总行数,但我想要当前行号。
<?php
$result = mysql_query('SELECT * FROM texts ORDER BY id desc');
while($row = mysql_fetch_array($result)){
$num_rows = mysql_num_rows($result);
?>
<tr class="alt">
<td><?php echo $row['id']; ?></td>
<td><?php echo $row['title']; ?></td>
<td><a href="<?php echo $row['orginal']; ?>">Original</a></td>
<td><a href="#">@English</a></td>
<td><a href="#"><?php echo $num_rows; ?></a></td>
</tr>
<?php
}
?>
谢谢 :)