我需要根据一周的下一个周日从 MySQL 查找一行数据。有人知道怎么做吗?
I need to lookup a row of data from MySQL based on the next Sunday of the week. Anyone know how?
您可以使用 PHP 确定下周日,然后将其传递给您的查询。
$nextSunday = date("Y-m-d", strtotime('next sunday'));
如果您需要某个日期的下周日,
$date = strtotime('2010-07-01'); $nextSunday = date("Y-m-d", strtotime('next sunday', $date));
请将此日期提供给您的查询
$result = mysql_query("SELECT * FROM table WHERE date = '$date'")
you can determine the next sunday using PHP then pass it to your query..
if you need the next sunday from a certain date
The provide this date to your query
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(1)
您可以使用 PHP 确定下周日,然后将其传递给您的查询。
如果您需要某个日期的下周日,
请将此日期提供给您的查询
you can determine the next sunday using PHP then pass it to your query..
if you need the next sunday from a certain date
The provide this date to your query