如何为每个获取行添加自动编号?我想自动添加新号码作为序列号,每个从 mysql 数据库中获取行?
<?php
$i=0;
$query=mysql_query("SELECT * FROM cart
WHERE email='".$_SESSION['email']."'");
while($rowdata1=mysql_fetch_array($query))
$i++;
{
?>
<?php echo $i ?> // here i want to add serial number
<?php echo $rowdata1['itemcode']?>
<?php echo $rowdata1['product']?>
<img src="admin/<?php echo $rowdata1['image'] ?>"/>
<?php echo $rowdata1['price']?>
<?php echo $rowdata1['size']?></font>
<?php echo $rowdata1['total']?>
<?php echo $rowdata1['date']?>
<?php $rowdata1['blueexnum']?>
<?php echo $rowdata1['blueexstatus']?>
<?php }?>
问题现在解决了谢谢
<?php
$i=0;
$query=mysql_query("SELECT * FROM cart
WHERE email='".$_SESSION['email']."'");
while($rowdata1=mysql_fetch_array($query))
{
$i++;
?>