$php_mysql$ Posted October 7, 2010 Share Posted October 7, 2010 friends i got my subcats stores like this subcat_id subcat_name id_cat 1 name 1 and i fetch them like this function getAllSubcategoryWithPrimaryCategory() { $subcategories = array(); $sql =" SELECT c.cat_name, sc.id_subcat, sc.subcat_name FROM `categories` AS c INNER JOIN subcategories AS sc ON c.id_cat = sc.id_cat order by c.cat_name asc , sc.subcat_name "; $rs = executeSql($sql); while($row = mysql_fetch_array($rs)) { $subcategories[] = $row; } return $subcategories; } now the thing is i have stored names like a b c d e f g h i j k l m n o p q other category but results are like this a b c d e f g h i j k l m n o other category p q Acending ways but i wish for the other category to show at the end of every subcategorym how could i get that done? Link to comment https://forums.phpfreaks.com/topic/215325-how-do-i-list-my-sub-cats-like-this/ Share on other sites More sharing options...
otuatail Posted October 7, 2010 Share Posted October 7, 2010 This should be in the MySql forum Link to comment https://forums.phpfreaks.com/topic/215325-how-do-i-list-my-sub-cats-like-this/#findComment-1119739 Share on other sites More sharing options...
$php_mysql$ Posted October 7, 2010 Author Share Posted October 7, 2010 oh yes sorry i made i mistake Link to comment https://forums.phpfreaks.com/topic/215325-how-do-i-list-my-sub-cats-like-this/#findComment-1119740 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.