Forums

This topic is locked

SQL and JOIN Help

Posted 17 Feb 2005 17:20:46
1
has voted
17 Feb 2005 17:20:46 Matt Bailey posted:
I'm only used to creating recordsets in dreamweaver in simple mode (PHP and MySQL), but im trying to do something a bit more complicated now. Perhaps someone could help.

One of my tables (called SectionTitle) has the names of sections and subsections on the site. Each Section can have any number of subsections, for example there is a section called Projects which has 14 subsections (each one being a separate page), Commercial, Research, Healthcare and so on. The table also has a row called 'SectionID' and another called 'SubSectionID'. It looks a bit like this

ID
SectionID
SectionTitle
SubSectionID
SubSectionTitle

The idea of using SectionID and SubSectionID is to link the data in this table to another so that I can display SectionTitle and SubSectionTitle on each page.

The table that this first table needs to link to has all the content for each SubSection. At the moment my second table (called ProjectContent) looks like this (I've omitted many of the rows because they're not important):

ID
SectionID
SubSectionID
ProjectTitle
ProjectCopy

This table also has the 2 rows, SectionID and SubSectionID so that I have corresponding values to link to the first table, therefore allowing me to pull the information out of 2 separate tables, but in one nice neat recordset.

Phew... I've been messing around in dreamweaver, but can't seem to acheive what I want. I'm sure it's simple but at the moment it all looks like gobbledygook!

Edited by - matm00 on 17 Feb 2005 17:22:18

Edited by - matm00 on 17 Feb 2005 17:29:37

Replies

Replied 17 Feb 2005 18:05:39
17 Feb 2005 18:05:39 Simon Martin replied:
Sounds to me like you need to consider normalising your tables
www.dmxzone.com/showDetail.asp?TypeId=28&NewsId=5831

SubSectionID and SubSectionTitle should probably be in their own table linked by ID numbers.

Live the life you love
Love the life you live
~ ~ ~ ~ ~ ~ ~
<b>Simon Martin</b> - <i>DMXzone Manager</i>
<font size=1>[ Dreamweaver MX/MX2004 | ASP | SQL | XHTML/CSS | Web Accessibility ] </font id=size1>
Replied 17 Feb 2005 18:12:34
17 Feb 2005 18:12:34 Matt Bailey replied:
Many thanks. I've purchased the article.

Reply to this topic