I'm having a hard time finding out a way to do this.
I'm setting up a database for clothing, with a wishlist function. Registered users can look up an item in the database, and click to add it to their wishlist.
Adding an item adds a row to table "wish", with columns for the username, the item's id number, and a wish-or-own column (which contains a 1 or 0).
I'd like to display the top five users who own the most items, as well as how many items they have.
In other words, I'd like to send a query to count how many times each username is duplicated, then return the count, and which usernames they are. How would this be possible? I've tried a number of things but none of them work.