Derleek Posted December 29, 2009 Share Posted December 29, 2009 Hi, I am looking to output one column of data in a MySQL DB to an excel file. Is there a way to go about doing this w/o installing a plugin? Quote Link to comment https://forums.phpfreaks.com/topic/186622-php-excel/ Share on other sites More sharing options...
Derleek Posted December 29, 2009 Author Share Posted December 29, 2009 can you just use the file manipulation commands in PHP and save the file as a .xls? Quote Link to comment https://forums.phpfreaks.com/topic/186622-php-excel/#findComment-985652 Share on other sites More sharing options...
Philip Posted December 29, 2009 Share Posted December 29, 2009 You could save it as a csv, fputcsv/fgetcsv. Quote Link to comment https://forums.phpfreaks.com/topic/186622-php-excel/#findComment-985654 Share on other sites More sharing options...
roopurt18 Posted December 29, 2009 Share Posted December 29, 2009 can you just use the file manipulation commands in PHP and save the file as a .xls? Yes, you can. You'll also have to find the specification for what the correct Excel file format is and put it in that format. Or you can put it in a CSV file as suggested since Excel understands CSV. Or you can just use one of the many PHP-to-Excel libraries. I don't see what the big deal with installing one is unless your shared host is a turd. Quote Link to comment https://forums.phpfreaks.com/topic/186622-php-excel/#findComment-985660 Share on other sites More sharing options...
Derleek Posted December 29, 2009 Author Share Posted December 29, 2009 my boss is a turd... He won't even accept PEAR lol Quote Link to comment https://forums.phpfreaks.com/topic/186622-php-excel/#findComment-985661 Share on other sites More sharing options...
Daniel0 Posted December 29, 2009 Share Posted December 29, 2009 There is some library called PHPExcel or something like that. I never tried it though. Quote Link to comment https://forums.phpfreaks.com/topic/186622-php-excel/#findComment-985666 Share on other sites More sharing options...
roopurt18 Posted December 30, 2009 Share Posted December 30, 2009 PHPExcel is good. It's very easy to use and works correctly. I attempted to create a very large spreadsheet with it once and performance suffered though. I recommend it for small to medium files. There is a PEAR Spreadsheet class as well which is good also. I don't understand your boss's design restriction against plug-ins. Unless he is an engineer or developer himself, his only concern should be if you can get it done and if there's a library that already exists that: 1) Will get it done faster 2) He can use commercially Then I don't see what the problem is. Then again my boss has absolutely zero experience designing software and he likes to force arbitrary design decisions on me as well. It's his way of putting his "personal stamp" on the project and rarely does it work out well for either of us. Quote Link to comment https://forums.phpfreaks.com/topic/186622-php-excel/#findComment-985837 Share on other sites More sharing options...
Derleek Posted December 30, 2009 Author Share Posted December 30, 2009 yes, he is a developer. His main concern is that he does not want to be tied into something that can go away. His Fear: We start to rely on an extension -> The project dies -> we find a bug -> our stuff breaks and we can't get support. Understandable... For bigger extensions. I don't think PEAR is going away any time soon so that one should be fine. It looks pretty light-weight too. Quote Link to comment https://forums.phpfreaks.com/topic/186622-php-excel/#findComment-985969 Share on other sites More sharing options...
roopurt18 Posted December 30, 2009 Share Posted December 30, 2009 Well then you can spend months on end developing it yourself. As long as the budget exists for it, who are you to complain? Quote Link to comment https://forums.phpfreaks.com/topic/186622-php-excel/#findComment-986052 Share on other sites More sharing options...
scanreg Posted December 31, 2009 Share Posted December 31, 2009 http://en.wikipedia.org/wiki/PHP_Excel_Reader Quote Link to comment https://forums.phpfreaks.com/topic/186622-php-excel/#findComment-986467 Share on other sites More sharing options...
Derleek Posted December 31, 2009 Author Share Posted December 31, 2009 Exporting a spreadsheet to XML gives a pretty good idea on how to go from XML -> Excel. He's actually approved the pear excel conversion class... It's a pretty easy extension. Although, I am having (conceptual) problems transferring the data returned by my AJAX queries to the PHP script to export to excel... it'll fall into place soon though =) Quote Link to comment https://forums.phpfreaks.com/topic/186622-php-excel/#findComment-986478 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.