On Tue, 2004-01-06 at 15:04, Jas wrote:
> require 'database.php';
> $t_02 = "subnets";
> $sql_subs = mysql_query("SELECT * FROM $t_02",$db)or
> die(mysql_error()); while(list($id,$sub,$msk,$dns01,$dns02,$rtrs,$rnge)
> = mysql_fetch_array($sql_subs)) {
> $num = mysql_num_rows($sql_subs);
> for($z = 0; $z < $num; $z++) {
> $vlans[] = "subnet $sub<br>netmask $msk {<br>option domain-name-servers
> $dns01, $dns02;<br>option routers $rtrs;<br>range $rnge;<br>}<br>"; }
> }
> // Write everything out formated...
> echo $vlans[$z]<br />\n;
>
> Right now it only pulling the last record???
You are only echo'ing the last record, $vlanz[$z]. You will need to loop
over $vlans again or put the echo line inside the for loop.
- Brad
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php