Arrays
Posted: Fri Oct 06, 2006 2:24 pm
Hi,
I'm new to arrays, and I'm having a little trouble trying to get something done... I've been working with the info on PHP.net. So, I have four variables from a row - air_id, air_name, air_type, and air_fleet. However, there are multiple rows each with its own unique air_id. What I want to do is store the information in an array so I just call something like $array['4'] to get the air_name, air_type, and air_fleet that corresponds with the air_id being 4. This is what I have right now, which obviously doesn't work:
can someone help me out?
Thanks!
- Jeff
I'm new to arrays, and I'm having a little trouble trying to get something done... I've been working with the info on PHP.net. So, I have four variables from a row - air_id, air_name, air_type, and air_fleet. However, there are multiple rows each with its own unique air_id. What I want to do is store the information in an array so I just call something like $array['4'] to get the air_name, air_type, and air_fleet that corresponds with the air_id being 4. This is what I have right now, which obviously doesn't work:
Code: Select all
$array[$acid] .= array("air_id" => $acid, "air_name" => $acname, "air_fleet" => $acfleet, "air_type" => $actype);
and this to display it:
".$array['1']."Thanks!
- Jeff