With all possible respect, what you posted aren't tables, those are lists. At a minimum, tables have names and one or more fields; each field will have a data type. Please post your table structure(s) and we can suggest methods you can use to generate the output you desire.
Shawn Green Database Administrator Unimin Corporation - Spruce Pine David Blomstrom <[EMAIL PROTECTED]> wrote on 11/09/2004 06:16:26 PM: > Oops, I forgot my follow up question... > > I now have two tables: > > TABLE 1 > > Alabama > Alaska > Arizona > Arkansas > California > Colorado > Connecticut > > TABLE 2 > > Far North > New England > Pacific Coast > South > Southwest > Rocky Mountains > > If I had put all of the above in one table, then it > would be easy to display them like this: > > FAR NORTH > Alaska > NEW ENGLAND > Connecticut > > But if I normalize my data, then I have to figure out > how to make "FAR NORTH" from Table 2 display in a row > just ahead of Alaska. > > How do you do that? Should I ask this on a PHP forum, > or is this something people do with MySQL? Or can you > use either one? > > Thanks. > > > --- [EMAIL PROTECTED] wrote: > > > Normalize, David. Normalize. Your Regions get their > > own table. If a > > country/state can belong to more than one region you > > will need another > > table to hold that association. > > > > I can't remember if this was ever recommended to > > you but I had a chance > > to re-read it recently and think this could help > > you to better understand > > the basic concepts of normalization. > > > > > http://dev.mysql.com/tech-resources/articles/intro-to-normalization.html > > > > Don't get caught up in the terminology he uses but > > pay close attention to > > how he organizes his sample data. > > > > Shawn Green > > Database Administrator > > Unimin Corporation - Spruce Pine > > > > David Blomstrom <[EMAIL PROTECTED]> wrote on > > 11/08/2004 09:30:41 > > PM: > > > > > I have a series of database tables focusing on the > > > world's nations. There are basic tables that give > > each > > > nation's abbreviation and parent (e.g. Eurasia) > > and > > > other tables that focus on information about the > > > people, government, etc. > > > > > > Now I want to introduce some regional headers. For > > > example, current displays might look something > > like > > > this: > > > > > > Denmark > > > Finland > > > France > > > Germany > > > Portugal > > > Spain > > > > > > Alaska > > > Arizona > > > Florida > > > Montana > > > Wyoming > > > > > > I want to somehow modify my MySQL tables and/or > > the > > > PHP scripts I use to display data so that I have > > the > > > option of displaying data just like above, OR like > > > this: > > > > > > NORTHERN EUROPE > > > Denmark > > > Finland > > > WESTERN EUROPE > > > France > > > Germany > > > SOUTHERN EUROPE > > > Portugal > > > Spain > > > > > > FAR NORTH > > > Alaska > > > SOUTHWEST > > > Arizona > > > SOUTH > > > Florida > > > ROCKY MOUNTAINS > > > Montana > > > Wyoming > > > > > > You can see an example of my ultimate goal at > > > > > > http://www.geoworld.org/about/guide/world/eur/remote.php? > > > order=2&direction=0&submit=Submit > > > I'm designing this page to function as a pop-up > > > window that stays open as people click from nation > > to > > > nation. It uses a PHP script to order the nations > > > alphabetically or by population or other topics. > > > > > > Eventually, I'd like to learn how to modify the > > switch > > > so that it can display nations or states with > > headings > > > - like ROCKY MOUNTAINS - then if you click another > > > setting, the nations are rearranged and the > > headings > > > aren't even visible. > > > > > > Anyway, I just wanted to ask for tips about > > > incorporating these regional headings into my > > > database. My first hunch is to simply add them to > > one > > > of "basics" tables, like this: > > > > > > NAME ID TYPE > > > United States usa Nation > > > Rocky Mountains rm Region > > > Colorado co State > > > Montana mt State > > > > > > That way, I can simply display the entire table as > > is > > > - complete with the headins - or I can use PHP to > > > block every row where TYPE = Region. > > > > > > Does this sound like sensible plan, or are there > > > better options? Thanks. > > > > > > __________________________________________________ > > > Do You Yahoo!? > > > Tired of spam? Yahoo! Mail has the best spam > > protection around > > > http://mail.yahoo.com > > > > > > -- > > > MySQL General Mailing List > > > For list archives: http://lists.mysql.com/mysql > > > To unsubscribe: > > http://lists.mysql.com/[EMAIL PROTECTED] > > > > > > > > > > __________________________________ > Do you Yahoo!? > Check out the new Yahoo! Front Page. > www.yahoo.com > >