return;
}
- # todo: get column names, do $hash{$primkey}{blah} = ...
- while (my @row = $sth->fetchrow_array) {
- # reverse it to make it easier to count.
- }
+ %retval = %{ $sth->fetchrow_hashref() };
$sth->finish;
}
#####
-# Usage: &dbReplace($table, %hash);
+# Usage: &dbReplace($table, $key, %hash);
# Note: dbReplace does optional dbQuote.
sub dbReplace {
- my ($table, %hash) = @_;
+ my ($table, $key, %hash) = @_;
my (@keys, @vals);
foreach (keys %hash) {
return @results;
}
-####################################################################
-##### Factoid related stuff...
-#####
-
-#####
-# Usage: &getFactInfo($faqtoid, $type);
-# Note: getFactInfo does dbQuote
-sub getFactInfo {
- return &dbGet("factoids", $_[1], "factoid_key=".&dbQuote($_[0]) );
-}
-
-#####
-# Usage: &getFactoid($faqtoid);
-sub getFactoid {
- return &getFactInfo($_[0], "factoid_value");
-}
-
-#####
-# Usage: &delFactoid($faqtoid);
-sub delFactoid {
- my ($faqtoid) = @_;
-
- &dbDel("factoids", "factoid_key",$faqtoid);
- &status("DELETED '$faqtoid'");
-
- return 1;
-}
-
sub dbCreateTable {
my($table) = @_;
- my(@path) = (".","..","../..");
+ my(@path) = ($bot_data_dir, ".","..","../..");
my $found = 0;
my $data;