我有一个在 while 循环中工作的弹出消息框,但在弹出地址字段中,所有条目都显示相同的地址。
谁能告诉我我做错了什么?
Html Jquery 脚本
<script type="text/javascript">
$(document).ready(function() {
$('#button').click(function(e) {
$('#modal').reveal({
animation: 'fade',
animationspeed: 600,
closeonbackgroundclick: true,
dismissmodalclass: 'close'
});
return false;
});
});
</script>
<table>
$query1=mysql_query("select * from customers order by id desc");
while($row1=mysql_fetch_array($result))
{
?>
<tr>
<td><div align="center"><?php echo $row1['firstname']; ?></div></td>
<td><div align="center"><?php echo $row1['lastname']; ?></div></td>
<td><div align="center"><?php echo $row1['dob']; ?></div></td>
<td><div align="center"><?php echo $row1['email']; ?></div></td>
<td><div align="center"><a href="#" class="button">Address</a></div></td>
<td><div align="center"><?php echo $row1['phone']; ?></div></td>
<td><div align="center"><?php echo $row1['country']; ?></div></td>
<td><div align="center"><?php echo $row1['city']; ?></div></td>
</tr>
<Popup Start>
<div id="modal">
<div id="heading">
Sign Up! Customer's Address
</div>
<div id="content">
<p><?php echo $row1['address']; ?></p>
</div>
</div>
<Popup End>
<?php }?>
</table>
弹出在表格的每一行中显示相同的地址