Jump to content

Recommended Posts

Posted

Hi ... any suggestions on how I can run a PHP page that gets data from a MYSQL dB, puts that data into a CSV file, and then emails me that CSV and I am wanting to do this once every day .. thus a CRON job?

 

Just don't have any idea how to create the CSV file and get it attached to an email where my big block is.

 

Thanx for suggestions.

Posted

This will need to be a cron job yes.

 

 

I had a quick google search for a mysql export to csv PHP script, I came across a few. You would have to tie in the emailing thing yourself, or find a script that can send attachments. Beware though if your database is large and you try executing a query to grab a lot of data you may end up locking your mysql tables for a long period (hence rendering your site's database unusable until the backup has finished).

 

Also, if you try sending a large CSV file there are limits to the size of file that can be emailed from TCH servers so this may cause an issue too.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...