-
May 3rd, 2006, 03:34 AM
#1
Thread Starter
Addicted Member
Export command?
Hi again, all
Is it possible to export tables from MySQL to PDF and/or XLS via PHP?
-
May 3rd, 2006, 03:50 AM
#2
Re: Export command?
I'm not exactly shure how you can do it but this may help :-)
Cheers,
Ryan Jones
-
May 3rd, 2006, 04:05 AM
#3
Thread Starter
Addicted Member
Re: Export command?
Thx, but it's rather complex
-
May 3rd, 2006, 04:54 AM
#4
Thread Starter
Addicted Member
Re: Export command?
Hmm, I've tried
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());
?>
but Reader won't accept it (headers, perhaps?). Excel can however open it as xls.
-
May 3rd, 2006, 05:20 AM
#5
Re: Export command?
It maybe because the MySQL files are normally exported with a .sql extension...
Cheers,
Ryan Jones
-
May 3rd, 2006, 05:33 AM
#6
Re: Export command?
No, this kind goes under comma separated value, CSV. That's why Excel can open it.
All the buzzt
CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
May 3rd, 2006, 05:37 AM
#7
Thread Starter
Addicted Member
-
May 3rd, 2006, 06:17 AM
#8
All the buzzt
CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|