I: Multi date insertion into mysql
am 12.06.2011 08:37:47 von italghana------=_NextPart_000_0003_01CC28DC.01B3F9B0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
I use a script get dates between a period of time giving the starting and
the ending date into something like this:
Day1 2011-06-11
Day2 2011-06-12
Day3 2011-06-13
What I want to know is , to get the results into mysql since the data comes
from a non mysql query.
Here is my code:
$current_date = strtotime('2011-02-01');
$end_date = strtotime('2011-02-07');
$day_count = 0;
$current_week = null;
do {
if ((int)($day_count / 7) + 1 != $current_week)
{
$current_week = (int)($day_count / 7) + 1;
echo ''.'week-'.$current_week.''.'
';
}
// echo date('Y-m-d', $current_date).'
';
$current_date = strtotime('+1 day', $current_date);
$day_count ++;
$current_day = (int)($day_count);
echo ''.'Day-'. $current_day.''. ' ( '. date( 'Y-m-d',
$current_date -1).')'.'
';
$totalDays = '';
}
while ($current_date <= $end_date);
The output sometimes becomes long and I want to insert the
data into mysql and then query it for a later work.
------=_NextPart_000_0003_01CC28DC.01B3F9B0--