Thanks Rodney
I have followed your suggestion (I think) and created a multidimentional array as follows
$region_list1_result = mysql_query($region_list1_sql);
while ($region_list_row = mysql_fetch_array($region_list1_result,MYSQL_NUM)) {
$tempvalues =array('article' => $region_list_row[2], 'read' => $region_list_row[3]);
$temparray = array('region' => $region_list_row[0], 'values' => $tempvalues);
$region_list_result = array_merge($region_list_result,$temparray);
}
$region_list2_result = mysql_query($region_list2_sql);
while ($region_list_row = mysql_fetch_array($region_list2_result,MYSQL_NUM)) {
$tempvalues =array('article' => $region_list_row[2], 'read' => $region_list_row[3]);
$temparray = array('region' => $region_list_row[0], 'values' => $tempvalues);
$region_list_result = array_merge($region_list_result,$temparray);
So now I have this array called $region_list_result that should be a list of regions and against each region is a list of articles each with a flag showing whether the article has been read or not.
I am still having trouble extracting and traversing this array (I guess that's why I was avoiding multidimentionals),
The output I would like is something like this.
For REGION1 you have 3 ARTICLES of which you have READ 3
For REGION2 you have 4 ARTICLES of which you have READ 1
From the following array (I'm not sure about the syntax for representing a multid array so hope this makes sense.)
[REGION1,[ARTICLE1,1]]
[REGION1,[ARTICLE2,NULL]]
[REGION1,[ARTICLE3,1]]
[REGION1,[ARTICLE4,1]]
[REGION2,[ARTICLE1,1]]
[REGION2,[ARTICLE2,NULL]]
[REGION2,[ARTICLE5,NULL]]
[REGION2,[ARTICLE6,NULL]]
Are you able to help futher ?