> Is there a quick and easy (HAH :-) way of doing the following:
> I have a DB and a table with id, date etc ..... now what I need is to
> create 3 years of entries for the date in advance of the system going
> (Rather than while they use it - hard to explain why but necessary).
> Is there an easy way to write a short PHP script that will populate
> field $stock with 3 years dates in advance from the current date,
> the format 02-03-200x ?  it's either this way or I go through and
> new onces argghhh (That's not a pleasant thought :-)

This will print out the dates for you. Adapt accordingly to insert into
your database.... can't shake this bad feeling that you're doing
something the hard way, though...

$end = 365 * 3;

    $date = date('d-m-Y',strtotime("today + $x days"));
    echo $date . "<br>\n";

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

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

Reply via email to