Schema for Files

From Web Developer Network Wiki
Jump to: navigation, search

The following SQL can be executed on a MySQL database to create a table for storing files.

It is a simple schema for storing a binary file and all related POST details for a file from a webform.

CREATE TABLE `comment_files` (
  `file_id` int(10) unsigned NOT NULL auto_increment,
  `name` varchar(255) default NULL,
  `size` bigint(20) default NULL,
  `type` varchar(100) default NULL,
  `data` longblob,
  PRIMARY KEY  (`file_id`)
) TYPE=MyISAM;
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox