[an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive]

MySQL Perl While Loop Example



If your SQL query will return more than one record, you will need to place the fetchrow() call in a while loop.

my (@telephone);
my $i = 0;
my $count;
while (@aRow = $sth->fetchrow())
{
    $telephone[$i] = @aRow[0];
    $i++;
}
$count = $i;

# @telephone can now be used to build an html table 
# to display all the telephone numbers in the "518"
# area code.

>>> NEXT >>>

[an error occurred while processing this directive]