1
我正在为db中多行的倒计时计时工作。我保存在我的数据库不同的时间..我想脚本波纹管显示倒计时时间对于每一行..db中多行的倒计时时间
<script type="text/javascript" src="jquery-2.0.3.js"></script>
<script type="text/javascript" src="jquery.countdownTimer.js"></script>
PHP代码
<?php $x = mysqli_query($con, "SELECT * FROM payment");
while($xx = mysqli_fetch_array($x))
{ ?>
HTML和Javascript
<span id="future_date"></span>
<script>
$(function(){
$('#future_date').countdowntimer({
dateAndTime : "<?php echo $xx['stop_time']; ?>",
size : "lg",
regexpMatchFormat: "([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})",
regexpReplaceWith: "$1:$2:$3:$4"
});
});
</script>
关闭php
<?php } ?>
为数据库
INSERT INTO `user` (`id`, `userid`, `stop_time`) VALUES
(1, '3', '2017-04-20'),
(2, '2', '2017-04-12');
(3, '9', '2017-05-10');
(4, '3', '2017-03-22');
(5, '7', '2017-04-01');
(6, '9', '2017-04-10');
我使用的代码,但只显示一行不是所有的数据库中的行。
请告诉我该怎么办
谢谢......它的工作原理 – owebindex