亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

正在回答

5 回答

DROP TABLE IF EXISTS `imooc_user222`;

CREATE TABLE `imooc_user2222`(

`id` int unsigned auto_increment key,

`username` varchar(20) not null unique,

password char(32) not null,

`sex` enum("男","女","保密") not null default"保密",

`face` varchar(50) not null,

`regTime` int unsigned not null

)CHARSET=utf8;

設置字符集

0 回復 有任何疑惑可以回復我~

CREATE DATABASE IF NOT EXISTS 'e-shop';

USE'e-shop';

--GUANLIYUAN

DROP TABLE IF EXISTS 'e-shop_admin';

CREATE TABLE 'e-shop_admin'(

'id' tinyint unsigned auto_increment key,

'username' varchar(20)not null unique,

'password' char(32)not null,

'email'varchar(50)not null

);


--FENLIE

DROP TABLE IF EXISTS 'e-shop_cate';

CREATE TABLE 'e-shop_cate'(

'id'smallint unsigned auto_increment key,

'cName' varchar(50)unique);


--SHANGPING

DROP TABLE IF EXISTS 'e-shop_pro';

CREATE TABLE'e-shop_pro'(

'id'int unsigned auto_increment key,

'pName'varchar(50)not null unique,

'pSn'varchar(50)not null,

'pNum'int unsigned default 1,

'mPrice' decimal(10,2)not null,

'iPrice'decimal(10,2)not null,

'pDesc'text,

'pImg'varchar(50)not null,

'pubTime'int unsigned not null,

'isShow'tinyint(1)default 1,

'isHot'tinyint(1)default 0,

'cId' smallint unsigned not null);


--YONGHU

DROP TABLE IF EXISTS 'e-shop_user';

CREATE TABLE 'e-shop_user'(

'id'int unsigned auto_increment key,

'username'varchar(20)not null unique,

'password'char(32)not null,

'sex'enum("男","女","保密")not null default"保密",

'face'varchar(50)not null,

'regTime'int unsigned not null);


--XIANGCHE

DROP TABLE IF EXISTS 'e-shop_album';

CREATE TABLE 'e-shop_album'(

'id' int unsigned auto_increment key,

'pid' int unsigned not ?null,

'albumPath'varchar(50)not ?null);


0 回復 有任何疑惑可以回復我~

CREATE database IF NOT EXISTS'e-shop';

USE'e-shop';

--管理員表

DROP TABLE IF EXISTS 'e-shop_admin';

CREATE TABLE 'e-shop_admin'(

'id' tinyint unsigned auto_increment key,

'username' varchar(20)not null unique,

'password' char(32) not null,

'email' varchar(50) not null);


--分類

DROP TABLE IF EXISTS 'e-shop_cate';

CREATE TABLE 'e-shop_cate'(

'id' smallint unsigned auto_increment key,

'cName' varchar(50) unique);



--商品

DROP TABLE IF EXISTS'e-shop_pro';

CREATE TABLE 'e-shop_pro'(

'id' int unsigned auto_increment key,'pName' varchar(50) not null unique,

'pSn' varchar(50) not null,

'pNum' int unsigned default 1,

'mPrice' decimal(10,2)not null,

'iPrice' decimal(10,2)not null,

'pDesc' text,

'pImg' varchar(50)not null,

'pubTime' int unsigned not null,

'isShow' tinyint(1)default 1,

'isHot'tinyint(1)default 0,

'cId' smallint unsigned not null);


--用戶表

DROP TABLE IF ?EXISTS 'e-shop_user';

CREAT TABLE 'e-shop_user'(

'id' int unsigned auto_increment key,

'username' varchar(20) not null unique,

'password'char(32)not null,

'sex'enum("男","女","保密")not null default "保密",

'face' varchar(50) not null,

'regTime' int unsigned not null);


--相冊

DROP TABLE IF EXISTS 'e-shop_album';

CREATE TABLE 'e-shop_album'(

'id'int unsigned auto_increment key,

'pid'int unsigned not null;

'albumPath'varchar(50)not null);


0 回復 有任何疑惑可以回復我~
#1

wxx 提問者

還是有問題
2015-05-05 回復 有任何疑惑可以回復我~
#2

陳校軍 回復 wxx 提問者

用戶表里面的 "CREAT" 這個單詞是干什么的? 還有相冊里面'pid'int unsigned not null;結尾為什么要有個";" 還有not null和"("挨那么太緊了點吧…… 這些問題都應該你自己發現的,所以還是要多寫,細心 別人的時間也珍貴,所以一些小的問題盡量自己去發現。
2015-05-06 回復 有任何疑惑可以回復我~
CREATE?database?IF?NOT?EXISTS'e-shop';
USE'e-shop';
--管理員表
DROP?TABLE?IF?EXISTS?'e-shop_admin';
CREATE?TABLE?'e-shop_admin'(
id?tinyint?unsigned?auto_increment?key,
username?varchar(20)not?null?unique,
password?char(32)?not?null,
email?varchar(50)?not?null);

--分類
DROP?TABLE?IF?EXISTS?'e-shop_cate';
CREATE?TABLE?'e-shop_cate'(
id?smallint?unsigned?auto_increment?key,
cName?varchar(50)?unique);


--商品
DROP?TABLE?IF?EXISTS'e-shop_pro';
CREATE?TABLE?'e-shop_pro'(
id?int?unsigned?auto_increment?key,'pName'?varchar(50)?not?null?unique,
pSn?varchar(50)?not?null,
pNum?int?unsigned?default?1,
mPrice?decimal(10,2)not?null,
iPrice?decimal(10,2)not?null,
pDesc?text,
pImg?varchar(50)not?null,
pubTime?int?unsigned?not?null,
isShow?tinyint(1)default?1,
'isHot'tinyint(1)default?0,
'cId'?smallint?unsigned?not?null);

--用戶表
DROP?TABLE?IF??EXISTS?'e-shop_user';
CREAT?TABLE?'e-shop_user'(
'id'?int?unsigned?auto_increment?key,
'username'?varchar(20)?not?null?unique,
'password'char(32)not?null,
'sex'enum("男","女","保密")not?null?default?"保密",
'face'?varchar(50)?not?null,
'regTime'?int?unsigned?not?null);

--相冊
DROP?TABLE?IF?EXISTS?'e-shop_album';
CREATE?TABLE?'e-shop_album'(
'id'?int?unsigned?auto_increment?key,
'pid'?int?unsigned?not?null,
'albumPath'?varchar(50)?not?null;)


0 回復 有任何疑惑可以回復我~

親,寫代碼仔細點就不會出錯了。 ?`albumPath varchar(50) not null` 后面的 “;”應該放到 “>”外面。 ?

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
手把手教你實現電商網站后臺開發
  • 參與學習       117253    人
  • 解答問題       2101    個

手把手教你用PHP搭建電子商務平臺,由淺入深教你搭建電商系統

進入課程

為什么會這樣呢

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號