Reply to Re: Datestamp an exported file from php/mysql

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на 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

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