否则更新类别回显显示图像
您好,
我需要在类别更新时显示图像,并且该图像最多显示 3 天
,我使用此但无法使用
$todaytime = time();
$timestamp = $show_wallpaper['timestamp'];
$timediffirence = "360000";
$minus = $todaytime - $timestamp;
if ($timediffirence > $minus) {
$new = "<img src='$siteurl/images/new.gif' />";
} else {
$new = "";
}
数据库信息
$sql = "SELECT SQL_NO_CACHE * FROM wallpaper WHERE categoryid = $catid order by wallpaperid desc LIMIT $from,$max_results";
,所以请帮助我修复它 我确实喜欢这个
IF 类别更新然后显示此图像 3 天,否则删除图像 这是我的任务 回复
HI
I Need to display an image when Category Update and that image display upto 3 days
i use this but not work
$todaytime = time();
$timestamp = $show_wallpaper['timestamp'];
$timediffirence = "360000";
$minus = $todaytime - $timestamp;
if ($timediffirence > $minus) {
$new = "<img src='$siteurl/images/new.gif' />";
} else {
$new = "";
}
database info
$sql = "SELECT SQL_NO_CACHE * FROM wallpaper WHERE categoryid = $catid order by wallpaperid desc LIMIT $from,$max_results";
so help me to fix it
I do like this
IF Category Update then display this image for 3 days else remove image
this is my task
reply
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,
$timediffirence
是一个数字,因此不需要用双引号引起来,首先尝试一下:其次,360000不是3天以秒为单位,它应该是
((60 * 60) * 24) * 3 = 259200
最后,通过打印
$minus
的值并将其与$时间差
Firstly,
$timediffirence
is a number, it does not therefore need to be in double quotes, try this first:Secondly, 360000 is not 3 days in seconds, it should be
((60 * 60) * 24) * 3 = 259200
Finally, try debugging by printing out the values of
$minus
and comparing it with$timediffirence