Php, Mysql and Excel
I am trying to write or find scripts that will:
1- create a script that will allow someone to Unsubscribe to a mailing list based on email address.
2- export data to a predefined excel file which will be used to print mail labels.
I have looked and looked and have found nothing which works properly.
Thank you for any and help.
Vai
Vai
Junior Poster in Training
75 posts since Jan 2008
Reputation Points: 12
Solved Threads: 5
do you have a mailing list setup that someone can unsubscribe from. if not, i recommend using www.mailing-manager.com . they will have everything you need.
i have a class to export mysql database to excel file. i have a working example if you need one.
kkeith29
Nearly a Posting Virtuoso
1,357 posts since Jun 2007
Reputation Points: 235
Solved Threads: 194
Keith,
If you have the a working example of exporting mysql data to excel I would appreciate that. The mailing list signup works almost flawlessly.... I just need to get the unsubscribe part working.
Thanks bud
Vai
Junior Poster in Training
75 posts since Jan 2008
Reputation Points: 12
Solved Threads: 5
catch me on skype sometime tomorrow and I will give you the url and credentials to the site. i would post it here but the example is in one of my administrative centers for a site that hasn't gone live yet and I don't want everyone having access.
also, send me your mailing list script so i can add the unsubscribe part.
kkeith29
Nearly a Posting Virtuoso
1,357 posts since Jun 2007
Reputation Points: 235
Solved Threads: 194
If you have the a working example of exporting mysql data to excel I would appreciate that.
A simple example.
<?php
$file="test.xls";
$test="<table border=1><tr><td>Cell 1</td><td>Cell 2</td></tr></table>";
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=$file");
echo $test;
?>
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
Nav33n,
That works to open an xls file, w/ cell 1- cell2 but what do I need to do to have actual data displayed from the database?
Thanks again
Vai
Junior Poster in Training
75 posts since Jan 2008
Reputation Points: 12
Solved Threads: 5
Instead of
$test="<table border=1><tr><td>Cell 1</td><td>Cell 2</td></tr></table>";
fetch the data from the database and use it.
$text = "Name \t Age \n"; //header
while($row = mysql_fetch_array($result)) {
$text.=$row['name']."\t".$row['age']."\n"; //records
}
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356