6 @EXPORT = qw(conv_i conv_date do_query dump_query);
9 my ($value, $default) = @_;
10 return (defined($value) && "$value" ne "") ? $value * 1 : $default;
15 return (defined($value) && "$value" ne "") ? $value : undef;
19 my ($form, $dbh, $query) = splice(@_, 0, 3);
21 if (0 == scalar(@_)) {
22 $dbh->do($query) || $form->dberror($query);
24 $dbh->do($query, undef, @_) ||
25 $form->dberror($query . " (" . join(", ", @_) . ")");
30 my ($level, $msg, $query) = splice(@_, 0, 3);
31 while ($query =~ /\?/) {
32 my $value = shift(@_);
33 $value =~ s/\'/\\\'/g;
34 $value = "'${value}'";
35 $query =~ s/\?/$value/;
38 $msg .= " " if ($msg);
40 $main::lxdebug->message($level, $msg . $query);