Web Hosting Support Manual
Web and Print Design - Web Hosting Support Manual

HOME

Account Overview

Getting Started

Control Panel 

FTP

Email Client Setup

CGI-bin

MySQL

 

HELPFUL TIPS

Reducing Spam

Preserving Server Space

Email Problems

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.
 

Copyright © 2000-2004 All rights reserved, Web and Print Design trading as www.webandprint.com.au