$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? Quote Link to comment Share on other sites More sharing options...
otuatail Posted October 7, 2010 Share Posted October 7, 2010 This should be in the MySql forum Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.