You are here: Re: Create a 3,6,9 and 12 monthly schedule « PHP Programming Language « IT news, forums, messages
Re: Create a 3,6,9 and 12 monthly schedule

Posted by NC on 11/15/87 11:27

bigfella wrote:
>
> could this be changed to produce a straight 31 days?

Of course:

$cutoff = strtotime('+31 days');
$now = time();
$day = $now + 24*60*60;
while ($day <= $cutoff) {
$date = date('Y-m-d', $day);
$insert = "INSERT INTO the_table SET date='$date'";
mysql_query($insert);
$day = $day + 24*60*60;
}

Read up on strtotime(), it's really powerful:

http://www.php.net/strtotime

Cheers,
NC

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация