建立數據庫表格

建立demodb表php

create database demodb;mysql

使用表格sql

 use demodb;函數

mysql> create table goods(
    -> id int unsigned not null auto_increment primary key,
    -> name varchar(64) not null,
    -> typeid int unsigned not null,
    -> price double(6,2) unsigned not null,
    -> total int unsigned not null,
    -> pic varchar(32) not null,
    -> note text,
    -> addtime int unsigned not null);
Query OK, 0 rows affected (0.34 sec)

mysql> desc goods;
+---------+----------------------+------+-----+---------+----------------+
| Field   | Type                 | Null | Key | Default | Extra          |
+---------+----------------------+------+-----+---------+----------------+
| id      | int(10) unsigned     | NO   | PRI | NULL    | auto_increment |
| name    | varchar(64)          | NO   |     | NULL    |                |
| typeid  | int(10) unsigned     | NO   |     | NULL    |                |
| price   | double(6,2) unsigned | NO   |     | NULL    |                |
| total   | int(10) unsigned     | NO   |     | NULL    |                |
| pic     | varchar(32)          | NO   |     | NULL    |                |
| note    | text                 | YES  |     | NULL    |                |
| addtime | int(10) unsigned     | NO   |     | NULL    |                |
+---------+----------------------+------+-----+---------+----------------+
8 rows in set (0.01 sec)

mysql> show create table goods \G
*************************** 1. row ***************************
       Table: goods
Create Table: CREATE TABLE `goods` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(64) NOT NULL,
  `typeid` int(10) unsigned NOT NULL,
  `price` double(6,2) unsigned NOT NULL,
  `total` int(10) unsigned NOT NULL,
  `pic` varchar(32) NOT NULL,
  `note` text,
  `addtime` int(10) unsigned NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
1 row in set (0.00 sec)

 

二、建立項目的目錄具體文件spa

-------------------code

         |----add.php 商品添加頁面blog

         |圖片

         |----edit.php 商品信息編輯表單頁rem

         |it

         |----index.php 商品信息瀏覽頁

         |

         |----action.php 執行商品信息添加和修改及刪除等操做處理

         |

         |----dbconfig.php 公共配置文件

         |

         |----menu.php 導航欄

         |

         |----uploads 上傳圖片的存放目錄

         |

         |----functions.php 公共函數庫文件、圖片信息的上傳、等比縮放等處理函數

相關文章
相關標籤/搜索