开发者

How to lookup data based on the next sunday of the week

开发者 https://www.devze.com 2022-12-30 05:53 出处:网络
I need to lookup a ro开发者_开发问答w of data from MySQL based on the next Sunday of the week. Anyone know how? you can determine the next sunday using PHP then pass it to your query..

I need to lookup a ro开发者_开发问答w of data from MySQL based on the next Sunday of the week. Anyone know how?


you can determine the next sunday using PHP then pass it to your query..

$nextSunday = date("Y-m-d", strtotime('next sunday'));

if you need the next sunday from a certain date

$date = strtotime('2010-07-01');
$nextSunday = date("Y-m-d", strtotime('next sunday', $date));

The provide this date to your query

$result = mysql_query("SELECT * FROM table WHERE date = '$date'")
0

精彩评论

暂无评论...
验证码 换一张
取 消