473,397 Members | 2,077 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Datestamp an exported file from php/mysql

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?

Jun 26 '06 #1
1 1756
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
Jun 26 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jason Reljac | last post by:
Howdy, I'm looking for a little help. I had a W2K server with Apache/PHP/mySQL installed and working. I had a specific page that ran a mySQL SELECT INTO OUTFILE and dumped the outfile into a...
3
by: Bert Sierra | last post by:
Hello -- I have what appears to be a simple PHP+MySQL query, but Dreamweaver consistently generates PHP code which won't parse. I've stared at the PHP code for several hours now, and I can't...
1
by: Peter Sullvan | last post by:
Sorry for being a little off-topic, but I guess PHP users are often MySQL users too. We have a few rather advanced calculation routines developed in C++. Currently we are using a Sybase ASA...
2
by: Steve | last post by:
Hi. I've got an exported database from an external system. It's in the format of MYI, MYD and frm extension files. However, one table in this database has book.frm, book.MYD, book.MYI _AND_...
0
by: Jason Reljac | last post by:
Howdy, I'm looking for a little help. I had a W2K server with Apache/PHP/mySQL installed and working. I had a specific page that ran a mySQL SELECT INTO OUTFILE and dumped the outfile into a...
8
by: Daniele Baroncelli | last post by:
How can I get the original datestamp of uploaded files? The array $_FILES doesn't seem to contain the original date. Any solution? Daniele
17
by: Phil M | last post by:
Hi all. I have am HTML web page where I upload an updated file which is always called document.pdf. Users get there, click on the icon and download the document.pdf. Below the icon/link where...
2
by: pzou | last post by:
Hi guys, I have created a report with Reporting Services 2005 that gets executed according to a schedule I have created, every working date and the output gets exported to a csv file. My problem is...
1
by: jpgoeth1 | last post by:
Hi, I'm brand-new to access 2007 and I need a little help building my first database. I'm importing from a text file and I'd like to add a datestamp as a separate column. This would hold the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.