Use Perl:

http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel-2.04/lib/Spreadsheet/WriteExcel.pm

use strict;
use warnings;
use DBI;
use Spreadsheet::WriteExcel;

my ($user, $pass, $db, $table) = ('foo', 'bar', 'test', 'users');

my $dbh = DBI->connect("DBI:mysql:database=$db", $user, $pass);
my $workbook = Spreadsheet::WriteExcel->new("$table.xls");
my $worksheet = $workbook->add_worksheet();

my ($col, $row) = (0, 0);

for (@{ $dbh->selectall_arrayref("SHOW COLUMNS FROM $table") }) {
    $worksheet->write($row, $col, $_->[0]);
    $col++;
}

for (@{ $dbh->selectall_arrayref("SELECT * FROM $table") }) {
    $col = 0;
    $row++;

    for (@{ $_ }) {
        $worksheet->write($row, $col, $_);
        $col++;
    }
}

____________________________________________________________
Eamon Daly



----- Original Message ----- 
From: "Scott Hamm" <[EMAIL PROTECTED]>
To: "'Mysql ' (E-mail)" <[EMAIL PROTECTED]>
Sent: Friday, August 20, 2004 11:02 AM
Subject: Brainstorming' time!


> Ok. I'm looking into alternatives. I'm trying to figure out an alternative
> to mysql exporting into xls file. Is there any another way you can export
> into file and make it readable? What format do you use? I'm open to ideas
> from experienced database programmers :) I'm upgrading the whole database
> system from stupid Access "database" into SQL variant, whether it be MySQL
> or SQL server (MeowSoft)


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to