Sharing the latest website creation (fiction site) (2) -- creating a database and a data table and creating a website --
The most important link in the backend of php development is to create a database and create a data table. because it has a direct relationship with the entire project, we should first create several data tables, lay the foundation for subsequent program writing
First, create a database article and then query the database.
Here we are writing about the novel station. I will create a read database, open phpmyadmin directly, and create it in it.
Of course, you can also use SQL statements.
Then we need to create a table. Here I have seen several tables:
Admin table:
Create table if not exists 'admin '(
'Id' int (11) not null AUTO_INCREMENT,
'Username' varchar (15) not null,
'Password' varchar (15) not null,
Primary key ('id ')
) ENGINE = MyISAM default charset = utf8 AUTO_INCREMENT = 5;
Insert into 'admin' ('id', 'username', 'Password') VALUES
(1, 'admin', '123 ');
Info table:
Create table if not exists 'info '(
'Id' int (11) not null AUTO_INCREMENT,
'Title' varchar (15) character set utf8 default null,
'Username' varchar (15) default null,
'Qq' varchar (15) default null,
'Email 'varchar (15) default null,
'Address' varchar (15) character set utf8 default null,
Primary key ('id ')
) ENGINE = MyISAM default charset = gbk AUTO_INCREMENT = 57;
New book list:
Create table if not exists 'newbook '(
'Id' int (11) not null AUTO_INCREMENT,
'Bookname' varchar (32) not null,
'Images' varchar (50) not null,
'Initduction 'varchar (100) not null,
'Author' varchar (11) not null,
Primary key ('id ')
) ENGINE = MyISAM default charset = gbk AUTO_INCREMENT = 4;
Page table:
Create table if not exists 'page '(
'Id' int (11) not null AUTO_INCREMENT,
'Title' varchar (15) not null,
'Images' varchar (100) not null,
'Content' varchar (100) not null,
Primary key ('id ')
ENGINE = MyISAM default charset = utf8 AUTO_INCREMENT = 156;
User table:
Create table if not exists 'user '(
'Id' int (11) not null AUTO_INCREMENT,
'Username' varchar (32) not null,
'Password' varchar (32) not null,
'Qq' varchar (32) not null,
Primary key ('id ')
) ENGINE = MyISAM default charset = utf8 AUTO_INCREMENT = 11;
After several tables are created, we will perform background development.