Hi again, all
Is it possible to export tables from MySQL to PDF and/or XLS via PHP?
:D
Printable View
Hi again, all
Is it possible to export tables from MySQL to PDF and/or XLS via PHP?
:D
I'm not exactly shure how you can do it but this may help :-)
Cheers,
Ryan Jones
Thx, but it's rather complex :D
Hmm, I've tried
but Reader won't accept it (headers, perhaps?). Excel can however open it as xls.PHP Code:<?php
$dbhost='localhost';
$dbusername='ODBC';
$dbuserpass='';
$dbname='Some_database';
mysql_connect ($dbhost, $dbusername, $dbuserpass);
mysql_select_db($dbname) or die('Cannot select database');
$query = "SELECT * INTO OUTFILE 'test.pdf' FROM users";
mysql_query($query) or die(mysql_error());
?>
It maybe because the MySQL files are normally exported with a .sql extension...
Cheers,
Ryan Jones
No, this kind goes under comma separated value, CSV. That's why Excel can open it.
Any ideas, then?
Cheers