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 March 25th, 2004, 06:34 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
Structure tips

ok, this isn't so much a request for help but some tips. so i have my site completely built and am now trying to insert all the information in the site into a database. (just trying to get it up and going right now, will work on making it database driven after that)

i am just seeking some tips on the best way to arrange everything in the database as this database will be used when i make the site completely database driven shortly.

all the database will be is the text from the site, urls to get there, and that's pretty much it.

so i was thinking of making the database like this
Code:
Table name: Content
-----------------------------
| ID | Page Title | Content |
-----------------------------

Table name: URLS
------------------
| ID | URL | CID |
------------------


the conent table will hold obviously the information that is stated. the page title (i.e. company history) and then content will hold the main text. i will not be storing the images in the database unless everyone thinks it will make things better. but i think i read somewhere that this is not true.
the second table will of course hold the urls to all the pages. the cid field is 'content id'. i was planning on using this to associate the url with the text. (or do i have it mixed around? should i have cid in the content table?)

but anyways...do i have the right idea in the way it will be built or do you recommend any other methods for designing the database such as what i will need based off of the site?

thanks


Reply With Quote
  #2  
Old March 26th, 2004, 12:26 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Structure tips

*bump*
anyone?

Reply With Quote
  #3  
Old March 26th, 2004, 03:59 PM
honcho's Avatar
honcho honcho is offline
Contributing User
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Cape Cod
Posts: 1,347 honcho User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 52 m 2 sec
Reputation Power: 3
RE: Structure tips

If there is a one-to-one relationship between URLs and Content, why not make it a single table with id, page_title, content, and url?

Also, why are you putting all your content into a database? I understand putting structured data into a database, but from the looks of your database design, it's unstructed and exactly the situation file systems are meant to handle.

Reply With Quote
  #4  
Old March 26th, 2004, 04:22 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: RE: Structure tips

Quote:
If there is a one-to-one relationship between URLs and Content, why not make it a single table with id, page_title, content, and url?


i guess i could do it taht way as well. i have not made my database yet, i'm just trying to get things in order so that i have a plan on how it will be built so i don't get half way through it and find i made a mistake doing it a certain way and have to start over.

Quote:
Also, why are you putting all your content into a database? I understand putting structured data into a database, but from the looks of your database design, it's unstructed and exactly the situation file systems are meant to handle.


i mainly want to do this to make managing my content easier then what it is now. the site is just over 100 pages in size. i have 3 templates to control the main aspects of it but i do not enjoy tracking down the .php file that holds my content for a particular product and changing it.

Reply With Quote
  #5  
Old March 26th, 2004, 06:29 PM
honcho's Avatar
honcho honcho is offline
Contributing User
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Cape Cod
Posts: 1,347 honcho User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 52 m 2 sec
Reputation Power: 3
RE: Structure tips

Quote:
i do not enjoy tracking down the .php file that holds my content for a particular product and changing it.


I'm not adovating *not* keeping content in a database, I'm simply saying that if you are going to keep data in a database, there is probably a better structure than by page.

For instace, you mention "products." I imagine you have several products and each has a name, a description, maybe a picture, a price, and other info. You should then have a product table that holds this information. How it's presented to the user shouldn't matter to the database design.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > Structure tips


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


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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT