Home  >  Article  >  Backend Development  >  PHP Desktop Center (1) Creating a Database_PHP Tutorial

PHP Desktop Center (1) Creating a Database_PHP Tutorial

WBOY
WBOYOriginal
2016-07-21 15:56:29881browse

This is my first time writing an article. I don’t know if it can be published. . I wrote the program so that everyone can refer to it. If there is any expert who can modify a better program,
please don’t forget to tell me. :P
The demo page of the source program is at elong.oso.com.cn/desk/
The first step is to create the database:
We will use the OSO database as a column to explain.
Log in to the database first. Then click on your database name on the left.
Enter the following command where you enter the command.
CREATE TABLE jpg (
id int(8) NOT NULL auto_increment,
url char(255) NOT NULL,
mess char(100) NOT NULL,
fromx char(50) NOT NULL,
url1 char(255) NOT NULL,
mess1 char(100) NOT NULL,
fromx1 char(50) NOT NULL,
url2 char(255) NOT NULL,
mess2 char(100) NOT NULL,
fromx2 char(50) NOT NULL,
url3 char(255) NOT NULL,
mess3 char(100) NOT NULL,
fromx3 char(50) NOT NULL ,
PRIMARY KEY (id)
);
CREATE TABLE jpg1 (
id int(8) NOT NULL auto_increment,
url char(255) NOT NULL,
mess char( 100) NOT NULL,
fromx char(50) NOT NULL,
url1 char(255) NOT NULL,
mess1 char(100) NOT NULL,
fromx1 char(50) NOT NULL,
url2 char(255) NOT NULL,
mess2 char(100) NOT NULL,
fromx2 char(50) NOT NULL,
url3 char(255) NOT NULL,
mess3 char(100 ) NOT NULL,
fromx3 char(50) NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE jpg2 (
id int(8) NOT NULL auto_increment,
url char(255) NOT NULL,
mess char(100) NOT NULL,
fromx char(50) NOT NULL,
url1 char(255) NOT NULL,
mess1 char(100) NOT NULL,
fromx1 char(50) NOT NULL,
url2 char(255) NOT NULL,
mess2 char(100) NOT NULL,
fromx2 char(50) NOT NULL,
url3 char(255) NOT NULL,
mess3 char(100) NOT NULL,
fromx3 char(50) NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE jpg3 (
id int(8) NOT NULL auto_increment,
url char(255) NOT NULL,
mess char(100) NOT NULL,
fromx char(50) NOT NULL,
url1 char( 255) NOT NULL,
mess1 char(100) NOT NULL,
fromx1 char(50) NOT NULL,
url2 char(255) NOT NULL,
mess2 char(100) NOT NULL,
fromx2 char(50) NOT NULL,
url3 char(255) NOT NULL,
mess3 char(100) NOT NULL,
fromx3 char(50) NOT NULL,
PRIMARY KEY (id )
);
CREATE TABLE jpg4 (
id int(8) NOT NULL auto_increment,
url char(255) NOT NULL,
mess char(100) NOT NULL,
fromx char(50) NOT NULL,
url1 char(255) NOT NULL,
mess1 char(100) NOT NULL,
fromx1 char(50) NOT NULL,
url2 char(255) NOT NULL,
mess2 char(100) NOT NULL,
fromx2 char(50) NOT NULL,
url3 char(255) NOT NULL,
mess3 char(100) NOT NULL,
fromx3 char(50) NOT NULL,
PRIMARY KEY (id)
);
These commands mean to create four tables to store data. This represents the four categories of images. If you want to add classes, you can add more tables and change the source program.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/318036.htmlTechArticleThis is my first time writing an article. I don’t know if it can be published. . I wrote the program so that everyone can refer to it. If there is any expert who can modify a better program, please don’t forget to let me know...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn