Sharing the latest website creation (fiction site) (2) -- creating a database and a data table and creating a website --

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.