Okay, here's the code. I'm sure there is a way to pull all the info using just ONE query, but obviously that's what I don't know how to do.... so here I am. ha.
I know a little about SQL and mySQL, but not much. Its safe to say I know a little about Perl, but not much.
Anyway, see the code below. Its a little long, as it displays each query to the database:
--------
# connect to the database first time
$dbh = DBI->connect ("DBI:$databaseserver:$dbase",$user,$password,
{RaiseError=>0,PrintError=>1})
|| &security("Unable to connect to database $dbase"

;
$sth = $dbh->prepare("show tables"

||
&security("Unable to access script Step t1b"

;
$sth->execute() || die("Unable to execute query<BR>"

;
# retreive the table data for email addresses
$sth = $dbh->prepare("select email from $tablename"

;
$sth->execute() || die("Unable to execute"

;
while (@ary = $sth->fetchrow_array()){
push(@tables,$ary[0]);
push(@types,$ary[1]);
push(@null,$ary[2]);
push(@key,$ary[3]);
push(@default,$ary[4]);
}
$length=@tables;
if (!$length){
print "The table <B><FONT color=\"#000080\">$tablename</FONT></B>
from database <FONT color=\"#800000\">$dbase</FONT> contains no columns.\n";
}
foreach $line (@tables){
print "$line\n";
}
$sth->finish();
$dbh->disconnect();
$sth="0";
# connect to the database second time
$dbh = DBI->connect ("DBI:$databaseserver:$dbase",$user,$password,
{RaiseError=>0,PrintError=>1})
|| &security("Unable to connect to database $dbase"

;
$sth = $dbh->prepare("show tables"

||
&security("Unable to access script Step t1b"

;
$sth->execute() || die("Unable to execute query<BR>"

;
# retreive the subject of the message
$sth = $dbh->prepare("select subject from $tablenameB where newsid='$newsid'"

;
$sth->execute() || die("Unable to execute"

;
while (@ary = $sth->fetchrow_array()){
push(@tables,$ary[0]);
push(@types,$ary[1]);
push(@null,$ary[2]);
push(@key,$ary[3]);
push(@default,$ary[4]);
}
$length=@tables;
if (!$length){
print "The table <B><FONT color=\"#000080\">$tablename</FONT></B>
from database <FONT color=\"#800000\">$dbase</FONT> contains no columns.\n";
}
foreach $line (@tables){
print "$line\n";
}
$sth->finish();
$dbh->disconnect();
# connect to the database for the third time
$dbh = DBI->connect ("DBI:$databaseserver:$dbase",$user,$password,
{RaiseError=>0,PrintError=>1})
|| &security("Unable to connect to database $dbase"

;
$sth = $dbh->prepare("show tables"

||
&security("Unable to access script Step t1b"

;
$sth->execute() || die("Unable to execute query<BR>"

;
# retreive the body of the message
$sth = $dbh->prepare("select thebody from $tablenameB where newsid='$newsid'"

;
$sth->execute() || die("Unable to execute"

;
while (@ary = $sth->fetchrow_array()){
push(@tables,$ary[0]);
push(@types,$ary[1]);
push(@null,$ary[2]);
push(@key,$ary[3]);
push(@default,$ary[4]);
}
$length=@tables;
if (!$length){
print "The table <B><FONT color=\"#000080\">$tablename</FONT></B>
from database <FONT color=\"#800000\">$dbase</FONT> contains no columns.\n";
}
foreach $line (@tables){
print "$line\n";
}
$sth->finish();
$dbh->disconnect();
exit;