pixeltrace Posted May 7, 2007 Share Posted May 7, 2007 guys, i need help, how can i view items in my database in alphabetical order? SELECT COUNT(*) FROM #__brand_name ORDER by cat_name DESC i tried this one but its not working. hope you could help me with this. thanks! Quote Link to comment https://forums.phpfreaks.com/topic/50319-solved-how-to-view-items-in-alphabetical-order/ Share on other sites More sharing options...
suttercain Posted May 7, 2007 Share Posted May 7, 2007 Try SELECT COUNT(*) FROM #__brand_name ORDER by cat_name DESC; Quote Link to comment https://forums.phpfreaks.com/topic/50319-solved-how-to-view-items-in-alphabetical-order/#findComment-247039 Share on other sites More sharing options...
mmarif4u Posted May 7, 2007 Share Posted May 7, 2007 What u get from ur query when u run it. Quote Link to comment https://forums.phpfreaks.com/topic/50319-solved-how-to-view-items-in-alphabetical-order/#findComment-247045 Share on other sites More sharing options...
genericnumber1 Posted May 7, 2007 Share Posted May 7, 2007 why count? SELECT * FROM #__brand_name ORDER by cat_name DESC Quote Link to comment https://forums.phpfreaks.com/topic/50319-solved-how-to-view-items-in-alphabetical-order/#findComment-247046 Share on other sites More sharing options...
pixeltrace Posted May 7, 2007 Author Share Posted May 7, 2007 its still the same. the items are viewed this way z a testing1 test testing its still not working. how do i fix this? Quote Link to comment https://forums.phpfreaks.com/topic/50319-solved-how-to-view-items-in-alphabetical-order/#findComment-247065 Share on other sites More sharing options...
pixeltrace Posted May 7, 2007 Author Share Posted May 7, 2007 its working now. thanks! Quote Link to comment https://forums.phpfreaks.com/topic/50319-solved-how-to-view-items-in-alphabetical-order/#findComment-247066 Share on other sites More sharing options...
mmarif4u Posted May 7, 2007 Share Posted May 7, 2007 Can u show us ur updated query. Quote Link to comment https://forums.phpfreaks.com/topic/50319-solved-how-to-view-items-in-alphabetical-order/#findComment-247070 Share on other sites More sharing options...
genericnumber1 Posted May 7, 2007 Share Posted May 7, 2007 my guess would be SELECT * FROM #__brand_name ORDER by cat_name ASC Quote Link to comment https://forums.phpfreaks.com/topic/50319-solved-how-to-view-items-in-alphabetical-order/#findComment-247073 Share on other sites More sharing options...
mmarif4u Posted May 7, 2007 Share Posted May 7, 2007 yes genericnumber1 ur query is right bcoz asc is used from upper order like A to Z, but desc is used for lower order like Z to A. Select * right here, not select count(*). count is mostly used for searching purpose. Quote Link to comment https://forums.phpfreaks.com/topic/50319-solved-how-to-view-items-in-alphabetical-order/#findComment-247084 Share on other sites More sharing options...
igor berger Posted May 7, 2007 Share Posted May 7, 2007 count(*) tells you how many records you have in your table. Quote Link to comment https://forums.phpfreaks.com/topic/50319-solved-how-to-view-items-in-alphabetical-order/#findComment-247519 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.