Hi Everyone, I am looking for the best way to create a PHP MYSQL Query to help me output a complete list of categories from my db.
The categories are football team names & I would like to display everyone who supports each football team.
For Instance:
I have 44 Manchester Utd fans / 65 Chelsea Fans in my DB.
I would like to group all together like
(Column Name) Manchester United Fans
List all 44 supporters here
(Column Name) Chelsea Fans
List all 65 supporters here
I am using the following
SELECT title, mcat, murl FROM tbl_name GROUP By mcat ORDER BY mcat DESC
Then using a while
while ($row = $stmt->fetchObject()) {
But I am only seeing one for each in my output.
What is it I am doing wrong?
Thanks in advance