This is a discussion on SQL to CSV within the MySQL forums, part of the Database Server Software category; --> I have a web form to collect data On submit I intend sending the data to my email address ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I have a web form to collect data On submit I intend sending the data to my email address and to a mysql database. Whats a simple way for me to get the mysql database to email me a csv file from the database? On request. And every day at 08.00 say. Garry Jones Sweden |
| |||
| "Garry Jones" <garry.jones@morack.se> wrote in message news:e1ej11$6gt$1@yggdrasil.glocalnet.net... >I have a web form to collect data > > On submit I intend sending the data to my email address and to a mysql > database. > > Whats a simple way for me to get the mysql database to email me a csv file > from the database? On request. And every day at 08.00 say. > > Garry Jones > Sweden > Use additional application on server, for example with cron scheduling Simplest way is writing such app in Python or Perl + any Cron on Linux/BSD/Unix MySQL5.1beta has got Event Schduler but MySQL doesn't have smtpclient functions. Artur |
| |||
| Artur Baæ wrote: > MySQL5.1beta has got Event Schduler but MySQL doesn't have smtpclient > functions. Heh! Zawinski's law has not (yet) affected MySQL! http://en.wikipedia.org/wiki/Zawinski%27s_Law I agree -- write a simple script on the server, run by cron, to dump data into a CSV file and then email that file. One can run a SQL query "SELECT ... INTO OUTFILE" to do this. See paragraph on SELECT ... INTO OUTFILE in the following page: http://dev.mysql.com/doc/refman/5.0/en/select.html Regards, Bill K. |
| |||
| > Artur Baæ" <nospam_artur@ebasoft.com.pl> skrev i meddelandet > news:e1el8l$32b$1@news.task.gda.pl... >> Whats a simple way for me to get the mysql database to email me a csv >> file from the database? Thanks for the advice yesterday. I can now retrieve the data on demand but it is still leaving me short of what I want to do. When the user submits the form I would like to immediately send a copy of the data entered to the users own email adress and my email adress (as backup incase there is an MySQL problem. Some way of doing a double form action so the data is sent both to mysql and formmail would be ideal. Any ideas? Garry Jones Sweden |
| ||||
| Garry Jones wrote: > When the user submits the form I would like to immediately send a copy of > the data entered to the users own email adress and my email adress (as > backup incase there is an MySQL problem. So you must have a script somewhere that is handling the form and inserting data into the MySQL database. I infer from your other postings that you're using PHP. There are functions that can be used in PHP to send email. Here's a tutorial on how to do use them: http://www.phpfreaks.com/tutorials/130/0.php Your PHP script that inserts data to MySQL has access to the form parameters, of course. Use the same values to populate the mail message as a string, and then send it with the PHP mail class. Regards, Bill K. |