Quote:
Originally Posted by Baph
TSM, far far far too over complicated....
Drop to a MySQL console, and play with the following...
Code:
$ndbconn = mysql_connect("localhost", "user", "password");
mysql_select_db("mysql");
$n_start_date = 1062521254; // Timestamp for 2003-09-02 11:47:34 taken from your DB
// The query adds fourteen days to the given date
$squery = "SELECT DATE_ADD(FROM_UNIXTIME($n_start_date), INTERVAL 14 DAY)";
$nresult = mysql_query($squery);
$s_new_date = mysql_result($nresult, 0, 0);
// Free the result
mysql_free_result($nresult);
// Disconnected
mysql_close($ndbconn);
echo "Your password will expire on $s_new_date";
Note the $squery variable. 
|
Ahh i thought that route before but it does not work.
This is not for password usage, its for finding all records in a table where they are within the period to now.
Ie i have a table of log entries that has a list of image downloads that the client has done, client X has a limit of 50 images per month/week/quarter/year but the start of each period has to be keyed to their periodstart date, ie startperiod is 2009-01-31, if user had yearly limits on then the start date would be 2008-01-31, if it was monthly it would be 2008-12-31, if it was weekly then it would be 2009-01-24.