Home >Backend Development >PHP Tutorial >Desktop Center (1) Create Database_PHP Tutorial
Source: Aosuo.com
Desktop Center (1) Create Database
Author: elong
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.