View Single Post
Old 06-03-2008, 10:12 AM   #8 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

The use of discrete global variables for something like this seems a little excessive. The data pattern is that of a simple array with $munitn being associated with some value. I can't see why using many different variables would be preferred over a simple array.

PHP Code:
$munit = array ();
while (
$row mysql_fetch_assoc($result))
{
    
$munit[$row['munit']] = (int) $row['mvar'];
}
var_dump($munit); 
Salathe is offline  
Reply With Quote
The Following User Says Thank You to Salathe For This Useful Post:
Dave (06-03-2008)