dennismonsewicz Posted March 19, 2008 Share Posted March 19, 2008 I was wondering if there is a way to count a number of entries in a SQL table? For example: If you have a field in the table named uploaded_username, and you want to count how many times a particular name shows up in that table. How would I achieve this? Sorry for the n00b question Link to comment https://forums.phpfreaks.com/topic/96859-counting-entries-in-a-sql-table/ Share on other sites More sharing options...
Barand Posted March 19, 2008 Share Posted March 19, 2008 to count a single name SELECT COUNT(*) as total FROM tablename WHERE uploaded_username = '$username' to count all names SELECT uploaded_username, COUNT(*) as total FROM tablename GROUP BY uploaded_username Link to comment https://forums.phpfreaks.com/topic/96859-counting-entries-in-a-sql-table/#findComment-495694 Share on other sites More sharing options...
dennismonsewicz Posted March 19, 2008 Author Share Posted March 19, 2008 Thanks bud, I figured out the problem I was having! Link to comment https://forums.phpfreaks.com/topic/96859-counting-entries-in-a-sql-table/#findComment-495712 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.