$start="2007-11-1";
$end="2007-12-5";
然后用strtotime将这个两个字符串的日期变成时间戳,然后循环,每次加86400(秒),然后在插入前再次将时间戳用date("Y-m-d", $timestamp);转换回字符串。
insert into table set date='$date'就可以。
$end="2007-12-5";
然后用strtotime将这个两个字符串的日期变成时间戳,然后循环,每次加86400(秒),然后在插入前再次将时间戳用date("Y-m-d", $timestamp);转换回字符串。
insert into table set date='$date'就可以。
$sm=2;
$sd=23;
$sy=2007; $em=3;
$ed=14;
$ey=2007;
//utc of start and end dates
$s=mktime(0,0,0,$sm, $sd, $sy);
$e=mktime(0,0,0,$em, $ed, $ey);
while($s<=$e){
print date('Y-m-d',$s)."< br >"; //display date in mySQL format
$s=$s+86400; //increment date by 86400 seconds(1 day) 请问如何比较时间大小。
for($i=0;$i<$days;$i++){
$date=date('Y-m-d',strtotime("2007-11-1",+$i day));
//INSERT into table SET date='$date';
}
insert into table1 select data from table2 where date between @date_f and @date_t