note 54478 deleted from function.date by aidan

From: Date: Sun, 31 Jul 2005 12:32:10 +0000
Subject: note 54478 deleted from function.date by aidan
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-92813@lists.php.net to get a copy of this message
Note Submitter: schalkl at mweb dot co dot za ---- Creating intervals for your database by using a existing date stamp and adding a interval to the existing date and write it to the database. You can add dates to the existing date by just changing the interval day. $datetime is a field in the database as well as $expire. So both will be in the database fields. Hope this script helps ;-) The script I use is as follows: // # Timestamp starts for beginning subscriptions // $datetime = date("Y-m-d G:i "); // # Timestamp ends for beginning subscription // // # Timestamp starts for end subscriptions // $n_start_date = "".time();; // # The following line can be changed for how long you would like your timestamp to take place. $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); $expire = "$s_new_date"; // # Timestamp ends for end subscription //

« previous php.notes (#92813) next »