我试图总结我上次开始如何自动生成序列号的步骤,如此处所示Auto generate serial numbers。就我自己而言,我已经能够提出一个代码给我我想要的东西。回复:自动生成自动增量编号
使用这行代码
SELECT COUNT(donor_id) + 1 AS Counter
FROM tbl_donors
我想是6 + 1的值;即6是记录的总数,1是新记录的附加数。但现在如何将它添加到将显示这里看到的所有值的表集http://www.netdataflow.com/rbme/是我遇到问题的地方。我使用Dreamweaver来建立我的桌面,下面是桌面代码
<div align="center">
<table width="1100" border="0" cellpadding="0" cellspacing="0">
<tr id="colhead">
<td width="30" height="30" id="labels"><div align="center"><strong>ID</strong>
</div></td>
<td width="200" height="30" id="labels"><div align="center"><strong>Donor
Name</strong></div></td>
<td width="100" height="30" id="labels"><div align="center">
<strong>Designation</strong></div></td>
<td width="250" height="30" id="labels"><div align="center">
<strong>Address</strong></div></td>
<td width="80" height="30" id="labels"><div align="center"><strong>City</strong>
</div></td>
<td width="80" height="30" id="labels"><div align="center"><strong>State</strong>
</div></td>
<td width="80" height="30" id="labels"><div align="center">
<strong>Country</strong></div></td>
<td width="100" height="30" id="labels"><div align="center"><strong>Phone</strong>
</div></td>
<td width="150" height="30" id="labels"><div align="center"><strong>Email
Address</strong></div></td>
</tr>
<?php do { ?>
<tr <?php
// technocurve arc 3 php bv block2/3 start
echo " style=\"background-color:$color\"";
// technocurve arc 3 php bv block2/3 end
?> id="rowlines">
<td id="labels"><div align="center"><?php echo $row_rsdonors['donor_id']; ?>
</div></td>
<td id="labels"><div align="center"><?php echo $row_rsdonors['donorname']; ?>
</div></td>
<td id="labels"><div align="center"><?php echo $row_rsdonors['designation']; ?>
</div></td>
<td id="labels"><div align="center"><?php echo $row_rsdonors['address']; ?>
</div></td>
<td id="labels"><div align="center"><?php echo $row_rsdonors['city']; ?></div>
</td>
<td id="labels"><div align="center"><?php echo $row_rsdonors['state']; ?></div>
</td>
<td id="labels"><div align="center"><?php echo $row_rsdonors['country']; ?>
</div></td>
<td id="labels"><div align="center"><?php echo $row_rsdonors['phone']; ?></div>
</td>
<td id="labels"><div align="center"><?php echo $row_rsdonors['emailaddr']; ?>
</div></td>
</tr>
<?php
// technocurve arc 3 php bv block3/3 start
if ($color == $color1) {
$color = $color2;
} else {
$color = $color1;
}
任何人都可以帮忙吗?如果可能的话,我会想添加到
SELECT COUNT(donor_id) + 1 AS Counter
FROM tbl_donors
到表格的第一行之前的ID。我愿意接受任何其他的想法或方式,或者可以手动编码表格,而不是使用Dreamweaver动态表格集。
我很感激你提前帮忙。
迈克
我不明白你所说的“汽车” – Strawberry
的定义现场处理这个? –
@Strawberry:对不起,重复。我只是想说自动生成或auto_increment号码 –