Professional Web Applications Themes

SQL to CSV - MySQL

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...

  1. #1

    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





    Garry Jones Guest

  2. #2

    Default Re: SQL to CSV


    "Garry Jones" <garry.jonesmorack.se> wrote in message
    news:e1ej11$6gt$1yggdrasil.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ć Guest

  3. #3

    Default Re: SQL to CSV

    What OS are you using?

    strawberry Guest

  4. #4

    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!
    [url]http://en.wikipedia.org/wiki/Zawinski%27s_Law[/url]

    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:
    [url]http://dev.mysql.com/doc/refman/5.0/en/select.html[/url]

    Regards,
    Bill K.
    Bill Karwin Guest

  5. #5

    Default Re: SQL to CSV

    > What OS are you using?

    Windows XP.

    Garry


    Garry Jones Guest

  6. #6

    Default Re: SQL to CSV

    > Artur Bać" <nospam_arturebasoft.com.pl> skrev i meddelandet
    > news:e1el8l$32b$1news.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 Guest

  7. #7

    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:
    [url]http://www.phpfreaks.com/tutorials/130/0.php[/url]

    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.
    Bill Karwin Guest

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139