热搜:NVER node 开发 php

php写每周数据问题代码

2024-09-18 14:55:01
php写每周数据问题代码

php 每周数据



自已写了一段PHP,发现只能读取当今天的数据,前几天的没显示出来,高手看看应怎改。

<?php@header("content-Type: text/html; charset=utf-8");require_once 'inc/site_config.php';require_once 'inc/db_connections.php';require_once 'inc/function.php';mysql_query('set character set "utf8"');?>无标题文档                                  	
    <?php $j = 0; for( $i = 0; $i <7; $i++ ){ //循环输出7天日期 if( (date('N',strtotime('-'.$i.' day'))) < 6 ){ //排除星期六天 echo '
  • '.(date('n月d日',strtotime('-'.$i.' day'))).'
  • '; $j++; } } ?>
<?php $j = 0; for( $i = 0; $i <7; $i++ ){ //循环输出7天内数据 if( (date('N',strtotime('-'.$i.' day'))) < 6 ){ //排除星期六天 $cur_time = mktime(0, 0, 0, date("m") , (date("d")-$i), date("Y")); //当天时间戳 $next_time = mktime(0, 0, 0, date("m") , (date("d")+1-$i), date("Y")); //第二天时间戳 $where = "`AccTime` >= '$cur_time' AND `AccTime` < '$next_time'"; echo ''; ?>
事件
前值
预期值
时间
日期
"> " class="item"> <?php $s_arr=array(); $i=0; $service_rs=mysql_query("select * from info where CateId='8' and $where order by InfoId desc limit 10"); while($service_row=mysql_fetch_assoc($service_rs)) { $s_arr[$i++]=$service_row; } for($i=0;$i<10;$i++) { ?>
" target="_blank"><?=$s_arr[$i]['Title']?>
<?=$s_arr[$i]['qz']?>
<?=$s_arr[$i]['yqz']?>
<?=$s_arr[$i]['time']?>
<?=$s_arr[$i]['AccTime']?>
<?php } ?> " class="item"> <?php echo ''; $j++; } } ?>

回复讨论(解决方案)

第101行 的 for( $i = 0; $i  内嵌第130行的 for($i=0;$i
你觉得合理吗?

原来是那里问题,把130行的改成I1解决了。。