否则更新类别回显显示图像

发布于 2024-09-15 09:30:01 字数 660 浏览 4 评论 0原文

您好,

我需要在类别更新时显示图像,并且该图像最多显示 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谢绝鈎搭 2024-09-22 09:30:01

首先$timediffirence是一个数字,因此不需要用双引号引起来,首先尝试一下:

$timediffirence = 360000;

其次,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:

$timediffirence = 360000;

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文