How can I do this? Can it be done with cron jobs? If so, where can I read up on how to do this?
I need to dump the data from my database into a CSV file every so many hours. I want the CSV file to be saved into a folder on the server. Is this even possible with MySQL? I’d appreciate any help on this.
PHP isn’t necessary. You can schedule a query to run periodically via a cron job and output to CSV using code like the following:
With the above query stored in a file, the cron command would look like
If you need to dump the whole database in a way that can be re-imported to the database, use
mysqldumpinstead.