jester626 Posted January 13, 2008 Share Posted January 13, 2008 OK, I know this is simple, but for some reason my brain is just not working through this for some reason. I have been able to successfully do a record count from an entire table, however in the table I have several categories that I want to list individually, next to each category I want to have a list of links under that category. For example: Personal Development (15) Leadership (10) Human Resources (5) I have gotten to the point of displaying each category by using the GROUP BY function ( SELECT * FROM TBL_ResourceLinks GROUP BY LinkCategory ) I have been trying to use the Sum function but I feel that is not the way to go. Can someone please help me get past this major brain cramp? Thanks, Quote Link to comment https://forums.phpfreaks.com/topic/85835-counting-records/ Share on other sites More sharing options...
Fyorl Posted January 13, 2008 Share Posted January 13, 2008 I would do the grouping in PHP rather than SQL. I don't know which method is more efficient though. Quote Link to comment https://forums.phpfreaks.com/topic/85835-counting-records/#findComment-438085 Share on other sites More sharing options...
nikefido Posted January 13, 2008 Share Posted January 13, 2008 are you using multiple queries or just one? (and thus dealing with more than one result set)? Can you show us the full query? Quote Link to comment https://forums.phpfreaks.com/topic/85835-counting-records/#findComment-438088 Share on other sites More sharing options...
GingerRobot Posted January 13, 2008 Share Posted January 13, 2008 Where is the count coming from? Is all the data in one table? Or do we have a list of categories in one table, linked by an ID to another table? Showing us your data structure would be useful. Quote Link to comment https://forums.phpfreaks.com/topic/85835-counting-records/#findComment-438120 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.