SQL to CSV

This is a discussion on SQL to CSV within the MySQL Database forums, part of the Database Forums category; I have a web form to collect data On submit I intend sending the data to my email address and ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2006
Garry Jones
 
Posts: n/a
Default SQL to CSV

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





Reply With Quote
  #2 (permalink)  
Old 04-11-2006
Artur Baæ
 
Posts: n/a
Default Re: SQL to CSV


"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


Reply With Quote
  #3 (permalink)  
Old 04-11-2006
strawberry
 
Posts: n/a
Default Re: SQL to CSV

What OS are you using?

Reply With Quote
  #4 (permalink)  
Old 04-11-2006
Bill Karwin
 
Posts: n/a
Default Re: SQL to CSV

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.
Reply With Quote
  #5 (permalink)  
Old 04-11-2006
Garry Jones
 
Posts: n/a
Default Re: SQL to CSV

> What OS are you using?

Windows XP.

Garry


Reply With Quote
  #6 (permalink)  
Old 04-11-2006
Garry Jones
 
Posts: n/a
Default Re: SQL to CSV

> 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



Reply With Quote
  #7 (permalink)  
Old 04-11-2006
Bill Karwin
 
Posts: n/a
Default Re: SQL to CSV

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.
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 06:26 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0