New station (novel station) share (ii)--Create a database and set up a data table

Source: Internet
Author: User

One of the most important aspects of the PHP development backend is the creation of a database and the creation of a data table, because he has a direct relationship with the entire project, so we first set up a few data tables for the back of the program pad underlying

First, we'll build the database article and then query the database.

Here we write the novel station, I will build a read database, directly open phpMyAdmin, in the inside to create it

Of course you can also write with SQL statements.

And then we're going to set up a table where I've simply seen a few tables:

Admin table:

CREATE TABLE IF not EXISTS ' admin ' (

' id ' int (one) not NULL auto_increment,

' username ' varchar (not NULL),

' Password ' varchar (not NULL),

PRIMARY KEY (' id ')

) Engine=myisam DEFAULT Charset=utf8 auto_increment=5;

INSERT into ' admin ' (' id ', ' username ', ' password ') VALUES

(1, ' admin ', ' 540548356 ');

Info table:

CREATE TABLE IF not EXISTS ' info ' (

' id ' int (one) not NULL auto_increment,

' title ' varchar (CHARACTER) SET UTF8 DEFAULT NULL,

' username ' varchar () DEFAULT NULL,

' QQ ' varchar (+) DEFAULT NULL,

' Email ' varchar DEFAULT NULL,

' Address ' varchar (CHARACTER) SET UTF8 DEFAULT NULL,

PRIMARY KEY (' id ')

) Engine=myisam DEFAULT CHARSET=GBK auto_increment=57;

List of new books:

CREATE TABLE IF not EXISTS ' Newbook ' (

' id ' int (one) not NULL auto_increment,

' BookName ' varchar (+) not NULL,

' Images ' varchar (not NULL),

' Introduction ' varchar (+) not NULL,

' Author ' varchar (one) not NULL,

PRIMARY KEY (' id ')

) Engine=myisam DEFAULT CHARSET=GBK auto_increment=4;

Page table:

CREATE TABLE IF not EXISTS ' page ' (

' id ' int (one) not NULL auto_increment,

' title ' varchar (not NULL),

' Images ' varchar (+) not NULL,

' Content ' varchar (+) not NULL,

PRIMARY KEY (' id ')

) Engine=myisam DEFAULT Charset=utf8 auto_increment=156;

User table:

CREATE TABLE IF not EXISTS ' user ' (

' id ' int (one) not NULL auto_increment,

' username ' varchar (+) not NULL,

' Password ' varchar (+) not NULL,

' QQ ' varchar (+) not NULL,

PRIMARY KEY (' id ')

) Engine=myisam DEFAULT Charset=utf8 auto_increment=11;

We've set up a few tables and we're going to do the backstage development.

New station (novel station) share (ii)--Create a database and set up a data table

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.