Robert Stankiewicz wrote: > Maybe, because of this ? >> $category[$row['name']] = $row; >> > .... >> $cat = $category[$ii]['name']; //=======this is line >> 36========== >> > > best regards > Robert > I'm afraid you lose me completely. What does the sort($category) have to do with the count or $ii or whatever it is that is screwing up the script. It works perfectly when the sort is not commented out. Why and how does that change anything. The order certainly does not change the number of rows, or does it? -- Hervé Kempf: "Pour sauver la planète, sortez du capitalisme." ------------------------------------------------------------- Phil Jourdan --- pj@xxxxxxxxxxxxx http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php