SQL: select * from categories where catid = '3' order by category select * from categories where catid = '47' and topcatid = '3'