How to search data based on the next Sunday of the week

I need to find a row of data from MySQL based on next Sunday of the week. Does anyone know how?

+2


a source to share


1 answer


you can define next Sunday using PHP, then pass that in your request.

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

      

if you need next Sunday from a certain date



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

      

Provide this date to your request

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

      

+6


a source







All Articles