MySQL column_info() output order

MySQL column_info() output order

am 07.05.2009 15:26:09 von Sebastian Reinhardt

Hello,

I'm new within Perl -Scripting and there are a lot of questions.

To query an MYSQL- database, I have written a short CGI/Perl- Script. It
is working well, except the naming of the result table!
I try to fetch the column names from my database, to use it for the
result table's head. I get the names, no problem so far, but these names
are not in same order, as stored in the database!

To fetch the names I use following code:

--------------snip------------------
my $sth = $dbh->column_info(undef,$d_base,$d_table,'%');
my $col_info = $sth->fetchall_arrayref();
$sth->finish();
my $i = 0;
foreach my $info(@$col_info)
{
$kat_info[$i]=@$info[3];
$i++;
}
--------------snip------------------

How can I get it in correct/ stored order?

Thanks

Sebastian Reinhardt



--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org