Solved

Display number of events in a city from the database

Posted on 2011-10-01
5
338 Views
Last Modified: 2012-05-12
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
Comment
Question by:PSTCAT
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 27

Accepted Solution

by:
Cornelia Yoder earned 500 total points
ID: 36897567
SELECT City, COUNT(*) FROM Table GROUP BY City
0
 

Author Comment

by:PSTCAT
ID: 36897579
Could you elaborate a little more for me please?

that didn't seem to work.

Cheers.
0
 
LVL 11

Expert Comment

by:maeltar
ID: 36897581
mysql_num_rows()
0
 

Author Comment

by:PSTCAT
ID: 36897602
OH don't worry. I've been coding since 9am. My brain has turned to mush.

I've fixed the problem. thanks.
0
 
LVL 27

Expert Comment

by:Cornelia Yoder
ID: 36897779
ok, glad you figured it out, happy to help :)
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question