Send Email with Table Data Export

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
marcusreed
Forum Newbie
Posts: 7
Joined: Sat Oct 10, 2009 12:11 pm

Send Email with Table Data Export

Post by marcusreed »

I am creating a site where users input data into a table and then run reports on that data. I want to be able to click a button that says "Email Report" and have that particular data exported into an already formatted excel file which is then sent as an attachment to the recipient. I don't even know where to get started on this one. Can someone please help?!
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

Re: Send Email with Table Data Export

Post by Mark Baker »

marcusreed wrote:I am creating a site where users input data into a table and then run reports on that data. I want to be able to click a button that says "Email Report" and have that particular data exported into an already formatted excel file which is then sent as an attachment to the recipient. I don't even know where to get started on this one. Can someone please help?!
First step is to extract the data from your database and insert it into the Excel file. For that, you need a library like PHPExcel
marcusreed
Forum Newbie
Posts: 7
Joined: Sat Oct 10, 2009 12:11 pm

Re: Send Email with Table Data Export

Post by marcusreed »

I have thumbed through the documentation for phpexcel and can't find where you can get the data from the database.
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

Re: Send Email with Table Data Export

Post by Mark Baker »

marcusreed wrote:I have thumbed through the documentation for phpexcel and can't find where you can get the data from the database.
PHPExcel doesn't extract any data from any database, it allows you to populate the cells in an Excel worksheet from data that you extract from the database.
Post Reply