OK, something is different. With your changes incorporated I have
if(!isset($new)) {
$new = array();
}
while($row = mysql_fetch_array($result1)) {
$new[] = array($row['name'] => $row['ID']);
}
while($row2 = mysql_fetch_array($result2)) {
$new[] = array($row2['name'] => $row2['ID']);
}
ksort($new);
This produced results (a step up!) but not good results, so I added:
foreach ($new as $name => $group_tag) {
print ("$name, $ID<br>");
}
To see what's in $new
It results in:
0, Array
1, Array
2, Array
...
422, Array
423, Array
Which isn't what I was expecting. What's wrong?
Edited to add:
I tried:
while($row = mysql_fetch_array($result1)) {
print ("$row[name], $row[ID]<br>");
$new[] = ..etc,
and this printed good data followed by 400 lines of 0, Array
I also tried commenting out the second While loop, and got the same result.