jeffmc21
12-09-2008, 10:47 PM
Hey guys...
I have a table that stores events for a youth group. I would like to retrieve the events for the next week with a call to that db table. This is the code I used for a similar project where I just wanted the next 4 events, regardless of how far away they were.
SELECT DATE_FORMAT(event_date,'%b %d') as event_day, `event_name` FROM `tbl_eventsName` WHERE `event_date` >= CURDATE() ORDER BY event_date LIMIT 4
Obviously I will change the table name and field names later, but what is the best way to adjust this call to only pull the events that occur in the next 7 days(week), regardless of how many there are. Or do I need a completely new sql call of some type?
Any help??
I have a table that stores events for a youth group. I would like to retrieve the events for the next week with a call to that db table. This is the code I used for a similar project where I just wanted the next 4 events, regardless of how far away they were.
SELECT DATE_FORMAT(event_date,'%b %d') as event_day, `event_name` FROM `tbl_eventsName` WHERE `event_date` >= CURDATE() ORDER BY event_date LIMIT 4
Obviously I will change the table name and field names later, but what is the best way to adjust this call to only pull the events that occur in the next 7 days(week), regardless of how many there are. Or do I need a completely new sql call of some type?
Any help??