Display number of events in a city from the database

There is box on my home page (when logged in) that I want to display the following information:

(number) Parties in (city)

The CITY is the city that the user has entered in their account information (This is stored in a MySQL database).
The NUMBER needs to be the total number of events in that City listed in the database.

So an example would be:

53 Parties in London

I've got the CITY to display but I can't work out how to add up the total amount of events in that City and display them on my page.

If you need more information, just ask.

Your help is much appreciated.
Thanks.



PSTCATAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Cornelia YoderConnect With a Mentor ArtistCommented:
SELECT City, COUNT(*) FROM Table GROUP BY City
0
 
PSTCATAuthor Commented:
Could you elaborate a little more for me please?

that didn't seem to work.

Cheers.
0
 
maeltarCommented:
mysql_num_rows()
0
 
PSTCATAuthor Commented:
OH don't worry. I've been coding since 9am. My brain has turned to mush.

I've fixed the problem. thanks.
0
 
Cornelia YoderArtistCommented:
ok, glad you figured it out, happy to help :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.