L
Lincoln
Guest
Hello!
I am trying to create a feature where the user can view all records with a date greater than one month ago. I have a script that calculates this date relative to todays date. Here it is:
<?php
// get the current timestamp into an array
$timestamp = time();
$date_time_array = getdate($timestamp);
$hours = $date_time_array['hours'];
$minutes = $date_time_array['minutes'];
$seconds = $date_time_array['seconds'];
$month = $date_time_array['mon'];
$day = $date_time_array['mday'];
$year = $date_time_array['year'];
// use mktime to recreate the unix timestamp
// subtract one month
$timestamp = mktime($hours,$minutes,$seconds,$month - 1,$day,$year);
$lastmonth = strftime('%Y %m %d',$timestamp);
?>
I would like to execute this search like this:
http://www.mysite.com/mydir/index.php?function=search&where_clause=Date>"$lastmonth"&page=0&table_name=mytable
I have the concept pretty clear but i'm not quite sure how to implement it.
Any help would be greatly appreciated.
Thank You! -lincoln
I am trying to create a feature where the user can view all records with a date greater than one month ago. I have a script that calculates this date relative to todays date. Here it is:
<?php
// get the current timestamp into an array
$timestamp = time();
$date_time_array = getdate($timestamp);
$hours = $date_time_array['hours'];
$minutes = $date_time_array['minutes'];
$seconds = $date_time_array['seconds'];
$month = $date_time_array['mon'];
$day = $date_time_array['mday'];
$year = $date_time_array['year'];
// use mktime to recreate the unix timestamp
// subtract one month
$timestamp = mktime($hours,$minutes,$seconds,$month - 1,$day,$year);
$lastmonth = strftime('%Y %m %d',$timestamp);
?>
I would like to execute this search like this:
http://www.mysite.com/mydir/index.php?function=search&where_clause=Date>"$lastmonth"&page=0&table_name=mytable
I have the concept pretty clear but i'm not quite sure how to implement it.
Any help would be greatly appreciated.
Thank You! -lincoln