Michael,
Another thing for you to be aware of. mysql_result() is not a very efficient method of retrieving data. mysql_fetch_array() or mysql_fetch_row() are faster.
For example:
$x = 0;
while (($row = mysql_fetch_array($sql)) && ($x < $n_subcategories)) {
$subcategories[$x]["subcategories"] = $row['subcategories'];
$x++;
}
Or, if you want the data from all rows:
$x = 0;
while ($row = mysql_fetch_array($sql)) {
$subcategories[$x]["subcategories"] = $row['subcategories'];
$x++;
}
This is off the top of my head - you may need to check the syntax, but I think it's right.
For documentation on these functions, try:
Nick
http://www.zend.com/phpfunc/
--
Nick Roper