tdnxxx444 Posted March 3, 2006 Share Posted March 3, 2006 I want to create a dynamic, generic function that will SELECT data from a mysql table based on various types of dates. The dates could be in the form of:1. No date2. A specific date3. A date range4. x many months from the current date i.e. mysql statement - EXTRACT(YEAR_MONTH FROM date) = EXTRACT(YEAR_MONTH FROM DATE_SUB(NOW(), INTERVAL x MONTH))5. etc -- whatever other variationsAnyone have any suggestions on the best way of accomplishing this? Link to comment https://forums.phpfreaks.com/topic/3959-dynamic-function-to-select-mysql-data-based-on-date/ Share on other sites More sharing options...
wickning1 Posted March 3, 2006 Share Posted March 3, 2006 if () {} elseif () {} elseif() {} ....:)Aren't those all basically date ranges? Have the user give you a start and an end, and figure out good defaults when they leave one or both empty. Link to comment https://forums.phpfreaks.com/topic/3959-dynamic-function-to-select-mysql-data-based-on-date/#findComment-13753 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.