that should do it :)
<?

$first_date = "2003-12-01";
$end_date = "2004-01-15";

$ufirst = strtotime($first_date);
$uend = strtotime($end_date);
echo "ufirst: " . $ufirst;
echo "<br>uend: " . $uend;
while($ufirst <= $uend){
 //do other stuff here, insert into database etc
 $ufirst = strtotime("+1 day", $ufirst);
 $formatted = date("d/m/Y", $ufirst);
 echo "<br>ufirst: " . $ufirst . " : " . $formatted;
}


?>

---
Luke

"Tommi Virtanen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> 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????
>
> }
>
> eg.
>
> first insert row is 35, 2003-12-01,0
> next should be 35,2003-12-02,0 etc....
> ...
> and last 35,2004-01-15,0

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to