• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 356
  • Last Modified:

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.



0
PSTCAT
Asked:
PSTCAT
  • 2
  • 2
1 Solution
 
Cornelia YoderArtistCommented:
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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now