建立資料庫表格

來源:互聯網
上載者:User

標籤:函數   des   項目   tab   函數庫   typeid   double   col   建立項目   

建立demodb表

create database demodb;

使用表格

 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: goodsCreate 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=latin11 row in set (0.00 sec)

 

2、建立項目的目錄具體檔案

-------------------

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

         |

         |----edit.php 商品資訊編輯表單頁

         |

         |----index.php 商品資訊瀏覽頁

         |

         |----action.php 執行商品資訊添加和修改及刪除等操作處理

         |

         |----dbconfig.php 公用設定檔

         |

         |----menu.php 導覽列

         |

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

         |

         |----functions.php 公用函數庫檔案、圖片資訊的上傳、等比縮放等處理函數

 

建立資料庫表格

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.