<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Comments on snippet: 'PHP Export MySql Table to Xls'</title>
    <description>Snipplr comments feed</description>
    <link>https://snipplr.com/</link>
    <lastBuildDate>Mon, 06 Apr 2026 03:38:57 +0000</lastBuildDate>
    <item>
      <title>brownrl said on 05/Oct/2009</title>
      <link>https://snipplr.com/view/16324/php-export-mysql-table-to-xls</link>
      <description>&lt;p&gt;You don't the Excel has  a default size. The best thing to do is select all Ctrl-A then double click the edge of the first column and all columns will spread out to the size that is needed. This code here makes the absolute most basic excel file possible. There might be some other php libs out to do more fancy stuff.&lt;/p&gt;</description>
      <pubDate>Mon, 05 Oct 2009 08:48:25 UTC</pubDate>
      <guid>https://snipplr.com/view/16324/php-export-mysql-table-to-xls</guid>
    </item>
    <item>
      <title>brownrl said on 27/Nov/2009</title>
      <link>https://snipplr.com/view/16324/php-export-mysql-table-to-xls</link>
      <description>&lt;p&gt;hmmmm&#13;
&#13;
What is happening according to your error is that on line 6 of your php you are outputting something... in my file line 6 is a comment...&#13;
&#13;
So when you get down to the part where the php is constructing and xls file and not an text/html file the web server is saying:&#13;
&#13;
"Yo jerk! your already started outputting text/html we can start output binary/xls"&#13;
&#13;
Check you line 6, post your code?&lt;/p&gt;</description>
      <pubDate>Fri, 27 Nov 2009 10:20:57 UTC</pubDate>
      <guid>https://snipplr.com/view/16324/php-export-mysql-table-to-xls</guid>
    </item>
    <item>
      <title>brownrl said on 17/Sep/2010</title>
      <link>https://snipplr.com/view/16324/php-export-mysql-table-to-xls</link>
      <description>&lt;p&gt;I use this base script numerous times. Normally I add a quick "if" there to convert "date" and "timestamp" fields from integers to human readable dates. I also have used this in combination with another html form to make a universal db exporter.&#13;
&#13;
This here is simply the base.&lt;/p&gt;</description>
      <pubDate>Fri, 17 Sep 2010 20:29:26 UTC</pubDate>
      <guid>https://snipplr.com/view/16324/php-export-mysql-table-to-xls</guid>
    </item>
    <item>
      <title>brownrl said on 08/Apr/2011</title>
      <link>https://snipplr.com/view/16324/php-export-mysql-table-to-xls</link>
      <description>&lt;p&gt;thats odd.&#13;
&#13;
check to make absolutely sure that you are not already starting output some where else in your program. A blank line of html will tell apache that this is now text and no longer allow the binary header stuff to go.&#13;
&#13;
You output looks like binary stuff, so really I believe that you are already outputting to the screen somewhere and you have error reporting turned off. Otherwise you would see an error like above: Warning: Cannot modify header information - headers already sent by&lt;/p&gt;</description>
      <pubDate>Fri, 08 Apr 2011 01:15:33 UTC</pubDate>
      <guid>https://snipplr.com/view/16324/php-export-mysql-table-to-xls</guid>
    </item>
    <item>
      <title>brownrl said on 27/Jun/2011</title>
      <link>https://snipplr.com/view/16324/php-export-mysql-table-to-xls</link>
      <description>&lt;p&gt;probably by outputing the data to file instead of out to the screen? So instead of "echo" add the data to a temp string, then write the big temp string to a file. file_put_contents( $temp , $somefile ).&lt;/p&gt;</description>
      <pubDate>Mon, 27 Jun 2011 19:23:34 UTC</pubDate>
      <guid>https://snipplr.com/view/16324/php-export-mysql-table-to-xls</guid>
    </item>
    <item>
      <title>brownrl said on 30/Mar/2012</title>
      <link>https://snipplr.com/view/16324/php-export-mysql-table-to-xls</link>
      <description>&lt;p&gt;http://stackoverflow.com/questions/7044790/problem-downloading-data-to-excel-using-php-pack-function &#13;
&#13;
talks about the char max. Never needed to have more than 255 chars in a cell. Take a look.&lt;/p&gt;</description>
      <pubDate>Fri, 30 Mar 2012 23:04:41 UTC</pubDate>
      <guid>https://snipplr.com/view/16324/php-export-mysql-table-to-xls</guid>
    </item>
  </channel>
</rss>
