Re: Problem with inserting numbers...
| From: | Chris Stinemetz | Date: | Thu, 11 Aug 2011 02:13:01 +0000 |
| Subject: | Re: Problem with inserting numbers... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-314479@lists.php.net to get a copy of this message | ||
>
> 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++;
}