Posted by Erwin Moller on 06/26/06 16:58
drec wrote:
> I have setup a script which will query a mysql db and then give the
> option to export this file to a filename that I have setup. As of now
> I am just calling it export.csv, but I would like to be able to add the
> date to this file name to avoid duplicates.
>
> Can anyone point me in the right direction?
Hi,
go to www.php.net and look for a function named date().
If you only feed the wished format, and not a timestamp, it will use now.
eg:
$filename = "backupOn";
$filename .= date('d_m_Y');
$filename .= ".csv";
will produce something like:
backupOn27_6_2006.csv
Just browse through all formatoption and take your pick.
Good luck.
Regards,
Erwin Moller
[Back to original message]
|