Results 1 to 3 of 3

Thread: DB Design

  1. #1

    DB Design

    Creating a CMS for a (1) Page Site http://working.bushidodeep.com/kevon/index.html

    I've gotten to the DB design and was wondering if it is as functional as it could be? The upload table will store urls to gif and .pdf files and


    The site DB will then populate the site as a PHP template.

    Code:
    Hi, 
    
    Are the following tables all that would be needed for this site CMS? The upload table URLS would point to image and pdf files. Pardon the vague post. 
    
    Site Table 
    	ID	int(6)		UNSIGNED	No		auto_increment	 	 	 	 	 	 	
    	header	varchar(100)	latin1_swedish_ci		Yes	NULL		 	 	 	 	 	 	 
    	subhead	varchar(100)	latin1_swedish_ci		Yes	NULL		 	 	 	 	 	 	 
    	content_main	text	latin1_swedish_ci		No			 	 	 				 
    	content_sub	text	latin1_swedish_ci
    Upload Table 
            upload_id	int(10)		UNSIGNED	No	auto_increment	 	 	 	 	 	 	
    	file_name	varchar(30)	latin1_swedish_ci		No			 	 	 	 	 	 	 
    	file_size	int(6)		UNSIGNED	No			 	 	 	 	 	 	
    	file_type	varchar(30)	latin1_swedish_ci		No			 	 	 	 	 	 	 
    	description	varchar(100)	latin1_swedish_ci		Yes	NULL		 	 	 	 	 	 	 
    	date_entered	timestamp		ON UPDATE CURRENT_TIMESTAMP	No	CURRENT_TIMESTAMP

  2. #2
    Ummm looks like it should work. Imma suggest a few things that could be changed
    1. Use utf8 for your Collation
    2. file_name - I'd increase to 255
    3. description, content_main, content_sub - change to mediumtext
    4. upload_id - mediumint, UNSIGNED is really more than enough , int is overkill IMO
    5. prolly store the upload path as well, separate from the file_name


    also, i'm not sure what storing the file_type is gonna help you with, if it's the extension you could just limit to like... varchar(6) or something
    Let us live so that when we come to die even the undertaker will be sorry. - Mark Twain
    Don't PM me your CSS, xHTML, JS or PHP questions. I will not reply to ANY IE6 questions.

  3. #3
    Should there be catagories for the uploads image or pdf?

    Also could you point to a clearer explanation of Collation than "googling" has returned?

    Quote Originally Posted by simplistik View Post
    Ummm looks like it should work. Imma suggest a few things that could be changed
    1. Use utf8 for your Collation
    2. file_name - I'd increase to 255
    3. description, content_main, content_sub - change to mediumtext
    4. upload_id - mediumint, UNSIGNED is really more than enough , int is overkill IMO
    5. prolly store the upload path as well, separate from the file_name


    also, i'm not sure what storing the file_type is gonna help you with, if it's the extension you could just limit to like... varchar(6) or something
    Last edited by cki; January 10th, 2008 at 03:13 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012