<?php $sql="SELECT COUNT(*) AS count FROM dc_content WHERE updatetime between time()-(date(h)*60*60+date(i)*60+date(s)) and time()-(date(h)*60*60+date(i)*60+date(s))+24*60*60";
$query=mysql_query($sql);
if($rs=mysql_fetch_array($query)){
$count=$rs[0];
}else{
$count=0;
}
echo $count;
?>是想查询 今天更新的数据 有多少条 但是数据库中 updatetime 为时间戳 !
$query=mysql_query($sql);
if($rs=mysql_fetch_array($query)){
$count=$rs[0];
}else{
$count=0;
}
echo $count;
?>是想查询 今天更新的数据 有多少条 但是数据库中 updatetime 为时间戳 !
SELECT COUNT(*) AS count FROM dc_content WHERE updatetime between UNIX_TIMESTAMP(curdate()) and UNIX_TIMESTAMP(curdate())+24*60*60-1