From: dms Date: Tue, 12 Sep 2000 15:12:37 +0000 (+0000) Subject: Fixed up stub dbGetRowInfo X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=58bb6945046c089b24fbc5ead82955558b1fd8a0;p=infobot.git Fixed up stub dbGetRowInfo git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@85 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/blootbot/src/db_mysql.pl b/blootbot/src/db_mysql.pl index 91620b9..658e914 100644 --- a/blootbot/src/db_mysql.pl +++ b/blootbot/src/db_mysql.pl @@ -108,7 +108,25 @@ sub dbGetCol { #### # Usage: &dbGetRowInfo($table); sub dbGetRowInfo { - &DEBUG("STUB: dbGetRowInfo()."); + my ($table) = @_; + + my $query = "SHOW COLUMNS from $table"; + my %retval; + + my $sth = $dbh->prepare($query); + &SQLDebug($query); + if (!$sth->execute) { + &ERROR("GRI => '$query'"); + &SQLDebug($DBI::errstr); + } + + my @cols; + while (my @row = $sth->fetchrow_array) { + push(@cols, $row[0]); + } + $sth->finish; + + return @cols; } #####