HighDots Forums  

Querying Database

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Querying Database in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
David B
 
Posts: n/a

Default Querying Database - 07-01-2004 , 02:00 AM






I have a database that lists all the world's continents, nations and
states, along with each jurisdiction's parent. For example, the parent
of Arizona is the United States, whose parent is North America.

I put screenshots of my tables online at
http://www.geoworld.org/tables1.gif and
http://www.geoworld.org/tables2.gif

Now I'm trying to figure out how to query, or fetch, a parent.
Specifically, I'm trying to make a "bread crumbs" type link that looks
something like this:

<div class="toplinks" id="toplinks<?=$mycode?>"><a
href="/index.php">MySite Home</a> &gt;
<a href="/world/">World</a> &gt; <a href="/world/afr/"> PARENT </a> &gt;
<span class="navhere"><?=$data_details['Name']?></span></div>
</div>

When displayed, it will look something like this:

MySite > World > Africa > Kenya - However, the continent and country
will vary.

The last value is supplied by <?=$data_details['Name']?>, which is
derived from a table named "area." If a particular page's Name is Kenya,
what do I do so that the name of its PARENT is displayed in the
preceding slot?

I would have to somehow indicate that table/field "area.Name" is related
to "family.Parent1," then I have to go back to "area.Name" to fetch the
parent's name.

Any tips?

Reply With Quote
  #2  
Old   
s_m_b
 
Posts: n/a

Default Re: Querying Database - 07-01-2004 , 05:42 AM






David B <david_blomstromDELETETHIS (AT) yahoo (DOT) com> wrote in
news:cc09av$bvr$1 (AT) forums (DOT) macromedia.com:

Bit fuzzy on your request here. Are you looking for an sql statement
that will do it? or something to do with the data relationships on the
sql tables?


Quote:
I have a database that lists all the world's continents, nations and
states, along with each jurisdiction's parent. For example, the parent
of Arizona is the United States, whose parent is North America.

I put screenshots of my tables online at
http://www.geoworld.org/tables1.gif and
http://www.geoworld.org/tables2.gif

Now I'm trying to figure out how to query, or fetch, a parent.
Specifically, I'm trying to make a "bread crumbs" type link that looks
something like this:

div class="toplinks" id="toplinks<?=$mycode?>"><a
href="/index.php">MySite Home</a
a href="/world/">World</a> > <a href="/world/afr/"> PARENT </a
span class="navhere"><?=$data_details['Name']?></span></div
/div

When displayed, it will look something like this:

MySite > World > Africa > Kenya - However, the continent and country
will vary.

The last value is supplied by <?=$data_details['Name']?>, which is
derived from a table named "area." If a particular page's Name is
Kenya, what do I do so that the name of its PARENT is displayed in the
preceding slot?

I would have to somehow indicate that table/field "area.Name" is
related to "family.Parent1," then I have to go back to "area.Name" to
fetch the parent's name.

Any tips?



Reply With Quote
  #3  
Old   
David B
 
Posts: n/a

Default Re: Querying Database - 07-01-2004 , 09:43 AM



s_m_b wrote:

Quote:
David B <david_blomstromDELETETHIS (AT) yahoo (DOT) com> wrote in
news:cc09av$bvr$1 (AT) forums (DOT) macromedia.com:

Bit fuzzy on your request here. Are you looking for an sql statement
that will do it? or something to do with the data relationships on the
sql tables?
No, I'm looking for a PHP solution. I can use the PHP code I listed in
my original post to display a jurisdiction's name. So there should be
some way to display that jurisdiction's parent...

If 'Name' (table "area") = Spain, then 'Parent1' (table "family) = keu
(the abbreviation for Eurasia), which should display as 'Name' of
Parent1 (table "area").


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.