]> git.donarmstrong.com Git - infobot.git/commitdiff
Fixed up stub dbGetRowInfo
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Tue, 12 Sep 2000 15:12:37 +0000 (15:12 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Tue, 12 Sep 2000 15:12:37 +0000 (15:12 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@85 c11ca15a-4712-0410-83d8-924469b57eb5

src/db_mysql.pl

index 91620b95b5366b1698c2e9e527d6a8ecd62a8af8..658e91400e938061496c008160c6cac8c7ee5eca 100644 (file)
@@ -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;
 }
 
 #####