Re: Generate automatic list of dates

From: Date: Tue, 02 Dec 2003 09:43:43 +0000
Subject: Re: Generate automatic list of dates
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-171552@lists.php.net to get a copy of this message
Tommi Virtanen wrote:
Hi! $first_date = 2003-12-01 $end_date = 2004-01-15 while ( $first_date <= $end_date) {
        $sql = "INSERT INTO time_table (id, date, person_id) VALUES (35,$first_date,0)";
        $result = mysql_query($sql, $conn);
        [next date] WHAT CODE TO HERE????
1) Convert current $first_date into timestamp, 2) add 1 day (in seconds), 3) convert it back to SQL-format and use it in next cycle-step.
}
-- Pavel a.k.a. Papi

« previous php.general (#171552) next »