$req_dates = "2007-12-20";
$req_end = "2007-12-25";
while ($req_dates <= $req_end) {
mysql_query("INSERT INTO test_request(req_dates, req_ident, req_emp, req_status, req_type, req_on_date) VALUES('$req_dates', '$req_ident', '$req_emp', '$req_status', '$req_type', '$req_on_date')") or die(mysql_error());
$req_dates = new DateTime($req_dates);
$req_dates->modify("+1 day");
$req_dates->format("Y-m-d");
}
I need to loop through this and add all the dates in the request into the database, but it just does the first. Any help would be greatly appreciated.