Results 1 to 8 of 8

Thread: Export command?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2005
    Posts
    236

    Export command?

    Hi again, all

    Is it possible to export tables from MySQL to PDF and/or XLS via PHP?

  2. #2
    Frenzied Member sciguyryan's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,763

    Re: Export command?

    I'm not exactly shure how you can do it but this may help :-)

    Cheers,

    Ryan Jones
    My Blog.

    Ryan Jones.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jul 2005
    Posts
    236

    Re: Export command?

    Thx, but it's rather complex

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Jul 2005
    Posts
    236

    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.

  5. #5
    Frenzied Member sciguyryan's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,763

    Re: Export command?

    It maybe because the MySQL files are normally exported with a .sql extension...

    Cheers,

    Ryan Jones
    My Blog.

    Ryan Jones.

  6. #6
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    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.

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Jul 2005
    Posts
    236

    Re: Export command?

    Any ideas, then?
    Cheers

  8. #8
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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
  •  



Click Here to Expand Forum to Full Width