php/mysql Date verification
Posted 05 May 2006 - 08:08 AM
Posted 05 May 2006 - 05:23 PM
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.
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-Day
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.
Posted 10 May 2006 - 05:56 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users