如何在我的sql下周日星期一到星期天

I am using below code for fetching next monday but i am unable to fetch next sunday on same week. like today is friday and if i search next week then i need to get next week monday to sunday.

SELECT now() + INTERVAL 7 - weekday(now()) DAY 

This above give me next monday.

I need to add 7 more days and get sunday date in same format.

2018-07-30 14:45:43 Monday

2018-08-05 14:45:43 Sunday

Add 6 days to get the sunday of the monday. Add 13 days to add the second sunday after the monday:

SELECT (now() + INTERVAL 7 - weekday(now()) DAY) + INTERVAL 6 DAY;

The strtotime() function is great for vague relative queries like this:

$monday = date('Y-m-d', strtotime('next monday'));
$sunday = date('Y-m-d', strtotime('next monday + 6 days'));

Yields:

2018-07-30
2018-08-05

If I understand correctly, you have gotten "2018-07-30 14:45:43" and need to get Sunday. Sunday is six days after Monday, so just add 6 to 7 and get 13.

SELECT now() + INTERVAL 13 - weekday(now()) DAY

How about

select monday, monday + interval 6 day as sunday from
(select now() + INTERVAL 7 - weekday(now()) DAY as monday) s1