2009/5/12 PJ <af.gourmet@xxxxxxxxxxxx>: > Could somebody please explain this? > When the line - sort($category) is commented out, the output returns > Notice: Undefined offset: in the line "36" for all the repeats (29 in > this case) Sure thing if you consider this: > The code below: > <? > $SQL = "SELECT name > FROM categories ORDER BY category_id > "; > $category = array(); > //[...] > $category[$row['name']] = $row; > //[...] while > $cat = $category[$ii]['name']; //=======this is line 36========== > After setting only $arr[NAMEfromDB], why should be a numeric index $arr[INT] ? Now just do var_dump($category) before and after your sort() - But I don't see why you still have it, when the query itself does the sorting. Regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php