Php, Mysql and Excel

Thread Solved

Join Date: Jan 2008
Posts: 74
Reputation: Vai is an unknown quantity at this point 
Solved Threads: 5
Vai Vai is offline Offline
Junior Poster in Training

Php, Mysql and Excel

 
0
  #1
Jul 10th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 1,227
Reputation: kkeith29 has a spectacular aura about kkeith29 has a spectacular aura about kkeith29 has a spectacular aura about 
Solved Threads: 167
kkeith29's Avatar
kkeith29 kkeith29 is offline Offline
Nearly a Posting Virtuoso

Re: Php, Mysql and Excel

 
1
  #2
Jul 10th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 74
Reputation: Vai is an unknown quantity at this point 
Solved Threads: 5
Vai Vai is offline Offline
Junior Poster in Training

Re: Php, Mysql and Excel

 
0
  #3
Jul 10th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 1,227
Reputation: kkeith29 has a spectacular aura about kkeith29 has a spectacular aura about kkeith29 has a spectacular aura about 
Solved Threads: 167
kkeith29's Avatar
kkeith29 kkeith29 is offline Offline
Nearly a Posting Virtuoso

Re: Php, Mysql and Excel

 
0
  #4
Jul 11th, 2008
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.
Last edited by kkeith29; Jul 11th, 2008 at 1:38 am.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 3,760
Reputation: nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough 
Solved Threads: 332
Moderator
Featured Poster
nav33n's Avatar
nav33n nav33n is offline Offline
Senior Poster

Re: Php, Mysql and Excel

 
2
  #5
Jul 11th, 2008
If you have the a working example of exporting mysql data to excel I would appreciate that.
A simple example.
  1. <?php
  2. $file="test.xls";
  3. $test="<table border=1><tr><td>Cell 1</td><td>Cell 2</td></tr></table>";
  4. header("Content-type: application/vnd.ms-excel");
  5. header("Content-Disposition: attachment; filename=$file");
  6. echo $test;
  7. ?>
Ignorance is definitely not bliss!

*PM asking for help will be ignored*
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 74
Reputation: Vai is an unknown quantity at this point 
Solved Threads: 5
Vai Vai is offline Offline
Junior Poster in Training

Re: Php, Mysql and Excel

 
0
  #6
Jul 11th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 3,760
Reputation: nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough 
Solved Threads: 332
Moderator
Featured Poster
nav33n's Avatar
nav33n nav33n is offline Offline
Senior Poster

Re: Php, Mysql and Excel

 
0
  #7
Jul 11th, 2008
Instead of
  1.  
  2. $test="<table border=1><tr><td>Cell 1</td><td>Cell 2</td></tr></table>";
fetch the data from the database and use it.
  1. $text = "Name \t Age \n"; //header
  2. while($row = mysql_fetch_array($result)) {
  3. $text.=$row['name']."\t".$row['age']."\n"; //records
  4. }
Ignorance is definitely not bliss!

*PM asking for help will be ignored*
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 849
Reputation: R0bb0b is on a distinguished road 
Solved Threads: 67
R0bb0b's Avatar
R0bb0b R0bb0b is offline Offline
Practically a Posting Shark

Re: Php, Mysql and Excel

 
0
  #8
Jul 11th, 2008
Originally Posted by nav33n View Post
  1. $test="<table border=1><tr><td>Cell 1</td><td>Cell 2</td></tr></table>";
Wow! That really works! I've always done just plain csv files, I didn't know you could use html. You've made my day.
  1. <?php
  2. $file="test.xls";
  3. header("Content-type: application/vnd.ms-excel");
  4. header("Content-Disposition: attachment; filename=$file");
  5. ?>
  6. <table cellpadding="0" cellspacing="0">
  7. <tr>
  8. <td>cell one</td>
  9. <td>cell two</td>
  10. <td>cell three</td>
  11. <td>cell four</td>
  12. </tr>
  13. <tr>
  14. <td colspan="4" align="center"><b>cell one</b></td>
  15. </tr>
  16. <tr>
  17. <td>cell one</td>
  18. <td>cell two</td>
  19. <td>cell three</td>
  20. <td>cell four</td>
  21. </tr>
  22. </table>

Freaking cool man! Thx.
“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” - Dr. Seuss

-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 3,760
Reputation: nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough 
Solved Threads: 332
Moderator
Featured Poster
nav33n's Avatar
nav33n nav33n is offline Offline
Senior Poster

Re: Php, Mysql and Excel

 
0
  #9
Jul 11th, 2008
You are welcome!
Ignorance is definitely not bliss!

*PM asking for help will be ignored*
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC