Re: [PHP-DB] Exporting mySQL to Excel
On 9 November 2011 23:52, Matijn Woudt wrote: > On Thu, Nov 10, 2011 at 12:32 AM, Ron Piggott > wrote: >> >> I am wondering how phpmyadmin makes Excel files "on the fly" --- Is it a >> class? >> > > They used PHPExcel in the past, but they had to remove because of > license issues. Don't know what they're currently using, but if you > can live with LGPL, PHPExcel might be an option. > > Matijn > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > If you can specify a TAB delimited file (assuming you don't have tab characters in your data), then this is a slight upgrade to CSV. -- Richard Quadling Twitter : EE : Zend : PHPDoc : Fantasy Shopper @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea : fan.sh/6/370 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Exporting mySQL to Excel
On Thu, Nov 10, 2011 at 12:32 AM, Ron Piggott wrote: > > I am wondering how phpmyadmin makes Excel files "on the fly" --- Is it a > class? > They used PHPExcel in the past, but they had to remove because of license issues. Don't know what they're currently using, but if you can live with LGPL, PHPExcel might be an option. Matijn -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Exporting mySQL to Excel
The problem you are describing is where the fields are not enclosed in quotes. Are you specifying to enclose alpha type fields in quotes, and leaving number-only fields without? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Exporting mySQL to Excel
I have tried to implement a CSV solution. Following a CSV header each field is displayed using this syntax: (Except the last doesn't end with a , but \r\n ) echo "\"" . trim( str_replace( '"' , '""' , stripslashes( mysql_result($listing_result , $i , "ministry_profiles.address_line_1") ) ) ) . "\" , "; I have these 2 problems: - Excel isn't providing a popup screen for me to specify the content of each field is contained within a pair of " and , is used to separate each field. - Additionally Excel is interpreting a comma as the start of a new field. This is problematic in fields where a comma legitimately exists in the middle of a field. I am wondering how phpmyadmin makes Excel files "on the fly" --- Is it a class? I am unsure how to proceed. Ron Piggott www.TheVerseOfTheDay.info -Original Message- From: Jimi Thompson Sent: Tuesday, November 08, 2011 4:59 PM To: Ron Piggott Cc: php-db@lists.php.net Subject: Re: [PHP-DB] Exporting mySQL to Excel The best option I've found is to write to a file that is then sent to the browser for download. Are there others? Yes but that's the one I've had the best experience with. It seems to work reliably regardless of browser or version of Office or any thing else. HTH! On Tue, 2011-11-08 at 13:31 -0500, Ron Piggott wrote: What is the preferred method used to export mySQL to Excel within the context of PHP? I have looked on Google and found a wide variety of options. Ron Ron Piggott www.TheVerseOfTheDay.info -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Exporting mySQL to Excel
On 8 November 2011 18:31, Ron Piggott wrote: > What is the preferred method used to export mySQL to Excel within the context > of PHP? I have looked on Google and found a wide variety of options. Ron > > Ron Piggott If the mysql server is set to allow remote access, then you could use ODBC and Excel to grab the data directly. Alternatively, if you have SSH or some sort of tunnelling capability, then with the tunnel in place, it would look like a local connection and again, ODBC with Excel could be your answer. I use NaviCat Lite to connect to mysql servers running inside Amazon's cloud services. I also Putty to create the tunnel and map the connection to allow the GoodData client to gather data from the mysql server for further reporting at GoodData. -- Richard Quadling Twitter : EE : Zend : PHPDoc : Fantasy Shopper @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea : fan.sh/6/370 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php