Hi,
I've used the following example in the past to build an array form within a loop.
$yeararray= array ();
//use the for loop to populate the array with the years
for ($i=0; $i<5; $i++)
{
$year = $thisyear+$i;
$yeararray[]=$year;
}
I need to do something similar to build a three dimensional array
$data = array();
$pointer = 0;
foreach ($rankarray as $rank)
{
foreach ($statusarray as $status)
{
$query = "SELECT * FROM HWBugBasic WHERE chassis LIKE '$chassis' AND drrank='$rank' AND status='$status'";
$result = mysql_query($query);
if ($result)
{
$total = mysql_num_rows($result);
$data[] = array ("rank"=>"$rank", "status"=>"$status", "value"=>"$total");
}
$pointer++;
}
}
I know there's something very wrong with the syntax here, but don't have enough programming knowledge to fix it. Can anyone help?