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

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

應該是不要單引號吧?

應該是不要單引號吧?


CREATE DATABASE IF NOT EXISTS shopImooc;
USE shopImooc;

DROP TABLE IF EXISTS imooc_admin;
CREATE TABLE imooc_admin(
id tinyint unsigned auto_increment key,
username varchar(20) not null unique,
password char(32) not null,
eamil varchar(50) not null
);

DROP TABLE IF EXISTS imooc_cate;
CREATE TABLE imooc_cate(
id smallint unsigned auto_increment key,
cName varchar(50) unique
);


DROP TABLE IF EXISTS imooc_pro;
CREATE TABLE imooc_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 imooc_user;
CREATE TABLE imooc_user(
id int unsigned auto_increment key,
username varchar(20) not null unique,
password char(32) not null,
sex enum("1","2","3") not null default "3",
face varchar(50) not null,
regTime int unsigned not null
);

DROP TABLE IF EXISTS imooc_album;
CREATE TABLE imooc_album(
id int unsigned auto_increment key,
pid int unsigned not null,
albumPath varchar(50) not null
);

正在回答

2 回答

是指字段,比如id、pid、username這些?你所說的引號那個是TAB鍵上面的那個頓號(反引號),如果是寫出引號(回車鍵左邊的)數據庫反而會報錯。頓號的作用是以防字段與數據庫關鍵字沖突,比如你要寫’刪除‘字段,你可能寫“delete”,這樣就和數據庫’DELETE‘關鍵字沖突了。這是我了解到的,歡迎指正~

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

乾坤龍心 提問者

非常感謝!
2015-12-28 回復 有任何疑惑可以回復我~
#2

乾坤龍心 提問者

我一直以為寫的是引號
2015-12-28 回復 有任何疑惑可以回復我~

太感謝了。。。。。這個引號坑了我好久

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

舉報

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

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

進入課程

應該是不要單引號吧?

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

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

幫助反饋 APP下載

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

公眾號

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