Re: Import/Export data

From: Date: Fri, 19 Apr 2002 00:31:15 +0000
Subject: Re: Import/Export data
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-18665@lists.php.net to get a copy of this message
mysql - Excel what I do very often an what really works great is (escpecially when customers need some download feature for db data for word/mail/excel processing and have no sql/phpMyAdmin knowledge) build a html data table using php: // file download_table.php <table> <?php while (...) ?> <tr>
    <td>value1</td><td>value2</td>
</tr> <?php } ?> </table> but instead of sending it to the browser as html file, send some "special" headers at the beginning of your script:
    Header("Content-Type: application/vnd.ms-excel");
    Header("Content-Disposition: attachment; filename=\"$filename\"");
now your browser "recognizes" the arising download of an excel file and asks you whether to downloading to disk or to open using excel :-) as excel is great in html :-P , it activates its html import filter and that's it! this method is very useful - with complex queries - as a download feature for "dumb users" mysql - Access Access is able to "get external data" out of an excel table... if you know more about the other way (excel/access -> mysql). what if you tried to access your mysql db from excel/access via the myODBC driver ? HTH steff Rosen Marinov wrote:
Hi, How can I import/Export data to MySQL database using PHP following formats: EDI, Access, Excel ? Where can I find information about this ? Thanks, Rosen Marinov


« previous php.db (#18665) next »