> Hello,
> 
> I'm trying to figure out how to get the data out of a table in a format 
> which I can easily import into excel. I wanted to have tab delimited fields 
> enclosed by quotes. I'm not sure how to do this? I check the mySQL doc and 
> saw the mysqldump call but haven't found any mention of it in the PHP doc.
> 
> Any thoughts? code snippets?
> 
> Thanks in Advance,
> 
> Mark Rosenberg
> Michigan State

First you need this header:

header("Content-Type: application/vnd.ms-excel");

Then here is a message I got a while ago from Pierre-Yves Lemaire:

Hello,

The header will make netscape offer you a download of the file, and
IE will open it in a excell format.

For the display, just put your result in a nice html table and excell will
convert
it, it's quite simple.

print "<table>";
print "<th>Event</th>";
... print all your header here

while ($row = mysql_fetch_array($result)) {
    print "<tr>\n";
    print "<td>". $row['Event'] ."</td>\n";
and so on...

}
</table>

hope it help,
py

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to