SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Nov 2004
    Location
    Far away
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What's the most efficient way?

    I've done a database scheme and wonder what the most efficient way of storing certain entries would be. The site will have news, reviews and tutorials and these will be under the same categories. So I'm wondering what the best way to do design the database scheme would be.

    Have one table like I've done now in the "content" table with the posibilty to differentiate the entries with the "post_type" field or have three different tables? Below is the table "content".

    Code:
    Field  	Type   	Null  	Default
    post_id  	int(10) 	No  	 
    post_date  	datetime 	No  	0000-00-00 00:00:00 
    post_text  	text 	No  	 
    post_title  	text 	No  	 
    post_cat_id  	int(4) 	No  	0 
    post_description  	text 	No  	 
    post_name  	varchar(200) 	No  	 
    post_type  	int(4) 	No  	0
    Last edited by emu5007; Dec 29, 2004 at 16:48.

  2. #2
    SitePoint Enthusiast
    Join Date
    Mar 2004
    Location
    Michigan
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, that's a good way to do it as long as news, reviews and tutorials each use the same input fields (like author, date, description, etc.).

  3. #3
    SitePoint Member
    Join Date
    Nov 2004
    Location
    Far away
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Drile's Friend
    Yes, that's a good way to do it as long as news, reviews and tutorials each use the same input fields (like author, date, description, etc.).
    They do! Author, date, categories and description will be the same input fields. I was hoping to have only a drop down in the form where I select whether it's news, review or tutorial at the end of the form. News would be marked as "0", reviews as "1" and tutorials as "2". Glad to hear I was thinking right.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •