#Sometimes we need to export data to a CSV file named with the timestamp of when the file was created. This can be done with the help of MySQL prepared statements. To illustrate this, we use the following example -
Example
The query in the following example will export data from table "student_info" to A CSV file with a timestamp in its name.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
|
The above query will create a CSV file named "student_2017_12_10_18_52_46.CSV", i.e. a CSV file with timestamp values, with the following data -
1 2 3 4 5 6 |
|
The above is the detailed content of How can I export data to a CSV file whose file name contains the file creation timestamp?. For more information, please follow other related articles on the PHP Chinese website!