package SQL;
use DBI;
our $dbh;
our $sth;
sub xqt
{
my $sCommand = shift;
$sth = $dbh->prepare($sCommand);
$sth->execute ();
}
####
use SQL;
my @tables;
my $temp;
SQL::Connect "debloat", "localhost";
SQL::xqt "SHOW TABLES";
my $i = 0;
while ($temp = $SQL::sth->fetchrow_arrayref)
{
$tables[$i] = $$temp[$i];
}
foreach (@tables)
{
print "$_\n";
}
####
use SQL;
my @tables;
SQL::Connect "debloat", "localhost";
SQL::xqt "SHOW TABLES";
my $i = 0;
while (my @ary = $SQL::sth->fetchrow_array ())
{
$tables[$i] = @ary;
$i++;
}
foreach (@tables)
{
print "$_\n";
}
####
sub PopList
{
my $cboList = shift(@_);
my $sCommand = shift(@_);
xqt $sCommand;
while (my @ary = $sth->fetchrow_array ())
{
$cboList->insert('end', @ary);
}
}
sub PopAgent
{
my $cboList = shift(@_);
PopList $cboList, "SELECT * FROM agent ORDER BY agent"
}