我要实现18:00前显示昨天数据18:00后显示今天数据,帮我看看这个语句有什么问题!! where newstime>=concat(date_format(date_add(now(),interval -1 day),'%Y-%m-%d'),' 18:00:00') 这个只实现了18:00前显示昨天数据,但是18:00后发的今天数据等到24:00才会显示该怎么写才显示18:00后是今天的数据
解决方案 »
- 求解:echo strtotime('2013-01-01 11:11:11')不同机器结果不同??
- 请教个php正则表达式的用法,求高手帮忙
- addJavaScript()问题
- 使用xml的一个问题
- 初学php,经常出现这种问题,想提问一下大侠!
- 提示找不到DLL,应该在哪配置php的路径啊
- 从MSSSQL读出图片的问题?
- 请问哪位有PHP4.3.0以上的版本??或者下载地址。请告之。谢谢!!急!!!在线等!!
- mysql数据库备份与还原的问题..
- 用setcookie("id",uniqid(rand()))产生的id变量写入数据库是不是看不到的?
- php基础问题求解答
- 我的博客可以显示时间!!
select 语句where newstime>='$yest'
$showtime=date("H:i:s");
if($showtime<'18:00:00')
{
$Datetime=date('Y-m-d' , strtotime('-1 day'));
}
ELSE
{
$Datetime=date('Y-m-d');
}
//echo $Datetime;
$query="select * from table where fd_time like '$Datetime%'";
$times=date('Y-m-d');
}
if(date('H:i:s',time())>"18:00:00"){
$times=date('Y-m-d' , strtotime('-1 day'));
}
$sql = "select * from table where fd_time like '%$times%'";