www.webdeveloper.com
Results 1 to 2 of 2

Thread: Inserting a File into a table

Hybrid View

  1. #1
    Join Date
    Feb 2010
    Posts
    3

    Question Inserting a File into a table

    I am fairly new to database design so correct me if the entire way I am wanting to do this is flawed.
    I am working on a very specific cms for meeting managment. The main table consists looks like this:


    Code:
    CREATE TABLE `meetings` (
    `ID` int(6) unsigned NOT NULL auto_increment COMMENT 'The unique ID of the meeting',
    `date` date NOT NULL COMMENT 'The date of the meeting',
    `agenda` text NOT NULL COMMENT 'The meeting agenda',
    PRIMARY KEY (`ID`)
    );

    I am also needing to upload minutes for each meeting but I cannot figure out which way would be best.


    Code:
    CREATE TABLE `meetings` (
    `ID` int(6) unsigned NOT NULL auto_increment COMMENT 'The unique ID of the meeting',
    `date` date NOT NULL COMMENT 'The date of the meeting',
    `agenda` text NOT NULL COMMENT 'The meeting agenda',
    `open_minutes` MEDIUMBLOB NULL COMMENT 'The open meeting minutes'
    PRIMARY KEY (`ID`)
    );


    or use the first table and have a second table



    Code:
    CREATE TABLE `open_minutes` (
    `ID` int(6) unsigned NOT NULL auto_increment COMMENT 'The unique ID',
    `date` date NOT NULL COMMENT 'The date of the meeting',
    `open_minutes` MEDIUMBLOB NULL COMMENT 'The open meeting minutes',
    PRIMARY KEY (`ID`)
    FOREIGN KEY (`date`) REFERENCE meetings(date)
    );

  2. #2
    Join Date
    Feb 2010
    Posts
    3
    I've been doing some more research and I'm not sure if this is at all what I want to do now. Is it safer/faster/better to upload the file to the server and just store the location in the database?
    In the end I am wanting to have certain files be protected from users that are not authenticated and that is more important than any other requirement.
    Thanks!

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

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



Recent Articles