程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 網頁編程 >> PHP編程 >> PHP綜合 >> 圖書管理程序(一)

圖書管理程序(一)

編輯:PHP綜合
本級程序所用的數據表結構:
# --------------------------------------------------------
#
# 數據表的結構 'author'
#

CREATE TABLE author (
   author_id int(6) DEFAULT '0' NOT NULL auto_increment,
   first_name varchar(20) binary NOT NULL,
   last_name varchar(20) NOT NULL,
   address varchar(100) binary NOT NULL,
   zipcode varchar(10) NOT NULL,
   telephone varchar(10) NOT NULL,
   email varchar(50) NOT NULL,
   comment varchar(255) NOT NULL,
   PRIMARY KEY (author_id),
   KEY first_name (first_name),
   KEY last_name (last_name),
   KEY address (address),
   KEY zipcode (zipcode),
   KEY email (email)
);

# --------------------------------------------------------
#
# 數據表的結構 'books'
#

CREATE TABLE books (
   books_id int(6) DEFAULT '0' NOT NULL auto_increment,
   books_name varchar(100) binary NOT NULL,
   publisher_id varchar(6) NOT NULL,
   date_pub datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
   type varchar(6) NOT NULL,
   pages varchar(4) NOT NULL,
   price float(6,2) DEFAULT '0.00' NOT NULL,
   comment varchar(255) binary NOT NULL,
   ISBN varchar(25) NOT NULL,
   PRIMARY KEY (books_id),
   KEY name (books_name),
   KEY publisher (publisher_id),
   KEY date_pub (date_pub),
   KEY price (price),
   KEY pages (pages),
   KEY type (type),
   KEY ISBN (ISBN)
);
# --------------------------------------------------------
#
# 數據表的結構 'books_author'
#

CREATE TABLE books_author (
   id int(6) DEFAULT '0' NOT NULL auto_increment,
   books_id varchar(6) NOT NULL,
   author_id varchar(6) NOT NULL,
   author_type varchar(6) NOT NULL,
   PRIMARY KEY (id)
);

# --------------------------------------------------------
#
# 數據表的結構 'publisher'
#

CREATE TABLE publisher (
   publisher_id int(6) DEFAULT '0' NOT NULL auto_increment,
   publisher_name varchar(100) binary NOT NULL,
   address varchar(100) NOT NULL,
   zipcode varchar(10) NOT NULL,
   telephone varchar(10) NOT NULL,
   telefax varchar(10) NOT NULL,
   email varchar(50) NOT NULL,
   PRIMARY KEY (publisher_id),
   KEY name (publisher_name),
   KEY address (address),
   KEY email (email)
);

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved