These tables will be used in the future.
1. Database design
Consists of 6 tables as follows:
2. Structure of each table
2.1 Table ' Author '
CREATE TABLE' author ' (' ID ')int( One) not NULLauto_increment, ' name 'varchar(255)DEFAULT NULL, ' password 'Char( +)DEFAULT NULL, ' email 'varchar(255)DEFAULT NULL, PRIMARY KEY(' id ')) ENGINE=InnoDB auto_increment=2827009 DEFAULTCHARSET=Utf8
2.2 Table ' Authorrole '
CREATE TABLE ' Authorrole ' ( int(notNULL ,varchar( 255 not NULL , PRIMARY KEY (' Authorid ', ' Roleid ')) ENGINE=DEFAULT CHARSET=UTF8
2.3 Table ' category '
create table int (11 ) not null auto_increment, ' name ' varchar (255 ) default null Span style= "COLOR: #000000", primary key = InnoDB auto_ Increment= 21 default charset= UTF8
2.4 Table ' joke '
CREATE TABLE' joke ' (' ID ')int( One) not NULLauto_increment, ' Joketext 'text, ' jokedate ' date not NULL, ' Authorid 'int( One)DEFAULT NULL, ' Visible ' enum ('NO','YES') not NULL, PRIMARY KEY(' id ')) ENGINE=InnoDB auto_increment= the DEFAULTCHARSET=Utf8
2.5 table ' jokecategory '
CREATE TABLE ' Jokecategory ' ( int(notNULL ,int( One not NULL , PRIMARY KEY (' Jokeid ', ' CategoryID ')) ENGINE=DEFAULT CHARSET=UTF8
2.6 Table ' role '
CREATE TABLE ' role ' ( varchar(255notNULL, varchar( 255 DEFAULT NULL , PRIMARY KEY (' id ')) ENGINE=DEFAULT CHARSET=UTF8
PHP and MySQL Web development from novice to expert, 3rd day-database design