douchou8935 2012-04-27 12:49
浏览 59

得到下一个即将到来的游戏,在星期一显示

There will be games at saturdays but not every weekend. I Want to show on a new week if there is an upcoming game that following saturday.

I was thinking of something like this to check 6 days ahead if we are on ex monday, if there is a game that saturday it should find it. But of course it lacks parts, just a start but Im stuck. As for now it finds the next game which is 1 month away, it should only show if there is one that week.

"Select * From games Where date > DATE_ADD(CURDATE(),INTERVAL 6 DAY)"
  • 写回答

2条回答 默认 最新

  • dpp34603 2012-04-27 12:58
    关注

    You can use PHP's DateTime class to find the date for next Saturday:

    $nextSaturday = new DateTime('next Saturday');
    

    From there, just select where the date equals $nextSaturday->format('Y-m-d') to find the games (if any) for next Saturday.

    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题