Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Display number of events in a city from the database

Posted on 2011-10-01
5
Medium Priority
?
349 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 2000 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

688 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