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