Click to See Complete Forum and Search --> : sending data into an email
joefox
Dec 18th, 2006, 10:35 AM
Is there a way to do a query, and put the results into a pre automated message, or dump it into an excel spreed sheet?
I wanted to have 2 options, 1 that says "email query" or "download" query, so they can select either or, and it will do wha they selected. :afrog:
something like:
to: xxxx@somewhere.com
subject: "overdue pos"
body:
Your query?
kows
Dec 18th, 2006, 01:09 PM
I don't understand what you're trying to do.
you want to email them an SQL query? email the results? or create an excel spread sheet of the results?
if you want to email the results of a query you can do that just by querying the database and looping stuff through. you could either put it all in HTML or all in plain text. if you did it with HTML, the people who would be receiving it would need to have an email client that supported HTML, otherwise it would be useless.. so I guess you could have the option for HTML or plain text, too. you just have to store it in a variable and then add it to the body of the mail() call..
I can't help you with exporting to Excel, and don't feel like looking around for where to even start. try Googling PHP exporting to Excel, or something like that.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.