Hi there chopthis,
Welcome to TDSN!
Not sure if I completely understand what you are after. Some more details would be helpful. However querying between dates isn't difficult.
Just add the condition to the WHERE cause of your select.
-
-
SELECT * FROM sometable
-
WHERE birthDate BETWEEN 'yourstartdate' AND 'yourenddate'
-
-
As far as the scripting is concerned, if you are wanting to use a current date stamp to base the query on then you could just use the mktime function like so:
-
//create your current date
-
$now = mktime(0, 0, 0, date("d"), date("m"), date("Y"));
-
-
//Set query start and end dates
-
$endDate = $now;
-
$startDate = mktime(0, 0, 0, date("d"), date("m"), date("Y")-8);
-
-
Then just pass those to your query like:
-
-
$myquery = mysql_query("SELECT * FROM mytable WHERE birthdate BETWEEN '$startDate' AND '$endDate'");
-
-
You may need to tweak it a little to fit your specifics, but something like that should get your the results you need.
Post back if you need additional assistance.
Regards,
Jenkins