> > basically all I'm trying to do is generate the last 4 digits starting at 0000 and going up to 9999. for testing purposes I'm just echoing back but will eventually insert the complete number back into the database as a 7 digit string. > > The error I'm getting is: > > Fatal error: Maximum execution time of 30 seconds exceeded in /home/pruimpho/public_html/jason/dev/clients/flewid/Phone/config/phoneareacodes.php on line25 > I'm not sure the to while loops is the best control structure. Why not try the following and see if it gets you the results you want? __untested__ while($row = mysql_fetch_assoc($result)) { if ($num != "10000") && $padnum = number_pad($num, "4") { echo $row['areacode'] . "-" . $row['prefix'] . "-" . $padnum . "<BR>"; $num++; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php