pugs1501 Posted May 5, 2006 Share Posted May 5, 2006 I was wondering if any one could help me figure out how to setup and seck to see if a start and end date which would be stored in the mysql database have been met or not. If the start date has been met and the end date has not i want it to display the data in the table if the start date has not been met or the end date has been met then the data should disapear off the screen then. Quote Link to comment Share on other sites More sharing options...
onepixel Posted May 5, 2006 Share Posted May 5, 2006 [!--quoteo(post=371467:date=May 5 2006, 03:08 AM:name=pugs1501)--][div class=\'quotetop\']QUOTE(pugs1501 @ May 5 2006, 03:08 AM) [snapback]371467[/snapback][/div][div class=\'quotemain\'][!--quotec--]I was wondering if any one could help me figure out how to setup and seck to see if a start and end date which would be stored in the mysql database have been met or not. If the start date has been met and the end date has not i want it to display the data in the table if the start date has not been met or the end date has been met then the data should disapear off the screen then.[/quote]If I understand your question the data will be displayed only if the $current_date is between your $start_date and $end_date?The date in mysql database will have the format Year-Month-DayFirst:$current_date=date("Y-m-d");Let's assume the columns for the start date and end date in your database table are: start_date and end_date. Your query will be something like:$query="Select field1, field2,... from Tablename where startdate<='".$currentdate."' and enddate>='".$current_date."'";You can then extract the results as you will. Quote Link to comment Share on other sites More sharing options...
pugs1501 Posted May 10, 2006 Author Share Posted May 10, 2006 thank you for your very quick response and all is working just fine but i was just wondering if you any one could help me write a if statement that will only show a title if their is results in the date statement. 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.