This is driving me batty!!!!!
I need to loop through a mysql result set and print one line for each row. Pretty simple huh! Well I am stumped. The code below produces one (the last) row. On a good note it is printing correctly formatted and accurately. Got any suggestions?
<?
$query = "select rid, rt_num, rt_name from route_lu where cid = ";
$query .= $SESSION['cid'];
$result = mysql_query($query );
$row = mysql_fetch_array($result );
$numrows = mysql_num_rows($result);
$subrow = 1;
while ( $row = mysql_fetch_array($result) )
{
$pline = "Menu1";
$pline .= $subrow;
$pline .= "=new Array(\"";
$pline .= $row['rt_name'];
$pline .= "\",\"#\",\"\",0,20,190,\"white\",\"black\",\"black\",\"white\",\"888888\",\"\",-1,-1,-1,\"\",\"\")";
print ($pline);
$subrow ++;
}
?>