|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
RE: Structure tips
*bump*
anyone? |
|
#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. |
|
#4
|
||||
|
||||
|
RE: RE: Structure tips
Quote:
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:
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. |
|
#5
|
||||
|
||||
|
RE: Structure tips
Quote:
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. |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > Structure tips |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|