homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderator: open

Databases Forum

MySQL question - nested groupings in a query

5+ Year Member

Msg#: 3968051 posted 10:37 pm on Aug 7, 2009 (gmt 0)

Here's the situation - I have a dataset that consists of individual tables holding info on 1) specific universities, 2) the campuses of each university, and 3) the programs offered by each campus.

I am trying to retrieve data in such a way as to be able to group the results on a web page by state, and within each state, to display only the campuses in that state.

For some reason I have a mental block here. Right now I make 50 separate calls to the database, one for each state (all the scripting is PHP). I know there is a better way and wish I know more about MySQL... any quick ideas?




WebmasterWorld Administrator lifeinasia us a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

Msg#: 3968051 posted 11:58 pm on Aug 7, 2009 (gmt 0)

Can you post the code you have so far? It should be a matter of just grabbing all the data to display with SQL, then parsing it correctly in PHP.


5+ Year Member

Msg#: 3968051 posted 3:44 pm on Sep 24, 2009 (gmt 0)

you have 3 tables but in which is the state info?

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved