Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old November 30th, 2002, 04:59 PM
jonathen jonathen is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Essex, UK
Posts: 44 jonathen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
Organising my db's/tables

Hi all,

Once again I humbly seek the help of those with more clue than I ;)

I have agreed to take on a project for the charity I do some voluntary work for, and I'm already beginning to regret it!

The first thing I need help on is regarding the db structure, and try as I might, I cannot get my head round the best db layout for this job, so any advice is appreciated

Basically, the site (a directory of addresses, cross referenced) is structured like so:

Directory Listing of addresses
>Area
>>Category
>>Advert

So for example:

Listing:
>Area 1
>>Category 1
>>>Listing 1 (address & link to advert)
>>>Listing 2 (address & link to advert)
>>>Listing 3 (address & link to advert)

...etc etc with areas, categories, addresses and adverts.

The problem I have, is how to structure the db in an efficient way so that I can develop a system where other people can login to an admin section and administer the listing, as well as a public facing system that displays the listings in correct order.

The thing is, often a listing (we'll use abc charity for example) needs to be cross-referenced. So a user wishes to add abc charity to:

Area 1 under category type 3
AND
Area 1 under category type 6
AND
Area 3 under category type 3
AND display an advert, which is linked to from the listing.

How do I ensure that when a listing is added once, it can be listed under multiple areas/categories, and when it is deleted, all entries of this listing under all areas/categories are removed in one foul swoop?

I'm not asking how to do all this in PHP - that comes later. I just need to know how to arrange the db for this to work, so that I can efficiently administer and display the DB in PHP without ending up with a mess 6 months down the line.

If it helps, there are 20 fixed areas each with 30 fixed categories (same cats throughout) - these will never change.

Do I need to create tables for area, category & advert? If so, how do I join them so I can cross-SELECT & cross-INSERT/UPDATE them without vast amounts of PHP?

Does any of this make sense?!

TIA

Jonathen

Reply With Quote
  #2  
Old December 4th, 2002, 07:24 PM
bob0099 bob0099 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: manchester,n.h.,usa
Posts: 172 bob0099 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
RE: Organising my db's/tables

http://www.wrox.com/books/1861006926.htm

Reply With Quote
  #3  
Old December 6th, 2002, 01:43 PM
CmdrDats CmdrDats is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: <br><img src='http://www.dats.co.za/icon.gif'>
Posts: 269 CmdrDats User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
Send a message via ICQ to CmdrDats Send a message via AIM to CmdrDats Send a message via Yahoo to CmdrDats
RE: Organising my db's/tables

have a table for your categories which have a id and refersto field so you can use the same table for subcategories (area, category and advert can all go in here)..

Then a advert table for the actual adverts, don't have a refersto field in here but give each advert an id.

then a advertlink table that contains a list of categoryid's and advertid's.. thereby linking them.. you'll have to figure the rest out by yourself though, coz it gets quite complex, especially when you want to start fuddling with permissions..

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > Organising my db's/tables


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

Request Your Free Technology Downloads!
 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

Request Your Free Technology Downloads!
 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

Request Your Free Technology Downloads!
 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

Request Your Free Technology Downloads!
 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek