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? Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.