I: Multi date insertion into mysql

------=_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 '<b>'.'week-'.$current_week.'</b>'.'
';

}

// echo date('Y-m-d', $current_date).'
';

$current_date = strtotime('+1 day', $current_date);

$day_count ++;

$current_day = (int)($day_count);

echo '<b>'.'Day-'. $current_day.'</b>'. ' ( '. 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--
italghana [ So, 12 Juni 2011 08:37 ] [ ID #2060933 ]
PHP » gmane.comp.php.database » I: Multi date insertion into mysql

Vorheriges Thema: problem in connecting to mysql from php
Nächstes Thema: mysql_query