Hi all...I'm new at perl, but trying...
I'm trying to get "@email" to hold all the email address from the mysql table...
but it only picks up , holds and prints the last email in the list....starting to really get to me....
I'm not sure how this works with mysql table....part of the code is below...
could anyone help on this one...thanks in adavance...Rob
$query = qq!
SELECT email
FROM $db_table
!;
$sth = $dbh->prepare ($query) or &cgierr("Unable to query database. Reason: $DBI::errstr. Query: $query");
$sth->execute or &cgierr("Unable to query database. Reason: $DBI::errstr. Query: $query");
@email = $sth->fetchrow_array;
foreach $name (@email)
{
print qq|<center><$font>$name </font> </center>
|;
}
I'm trying to get "@email" to hold all the email address from the mysql table...
but it only picks up , holds and prints the last email in the list....starting to really get to me....
I'm not sure how this works with mysql table....part of the code is below...
could anyone help on this one...thanks in adavance...Rob
$query = qq!
SELECT email
FROM $db_table
!;
$sth = $dbh->prepare ($query) or &cgierr("Unable to query database. Reason: $DBI::errstr. Query: $query");
$sth->execute or &cgierr("Unable to query database. Reason: $DBI::errstr. Query: $query");
@email = $sth->fetchrow_array;
foreach $name (@email)
{
print qq|<center><$font>$name </font> </center>
|;
}