新聞中心
在PHP開(kāi)發(fā)中,經(jīng)常會(huì)使用到MySQL語(yǔ)句,下面就為您列舉了一些經(jīng)常使用的MySQL語(yǔ)句,希望對(duì)您平時(shí)的學(xué)習(xí)和開(kāi)發(fā)工作能起到些許的作用。

10余年的晉安網(wǎng)站建設(shè)經(jīng)驗(yàn),針對(duì)設(shè)計(jì)、前端、開(kāi)發(fā)、售后、文案、推廣等六對(duì)一服務(wù),響應(yīng)快,48小時(shí)及時(shí)工作處理。營(yíng)銷型網(wǎng)站建設(shè)的優(yōu)勢(shì)是能夠根據(jù)用戶設(shè)備顯示端的尺寸不同,自動(dòng)調(diào)整晉安建站的顯示方式,使網(wǎng)站能夠適用不同顯示終端,在瀏覽器中調(diào)整網(wǎng)站的寬度,無(wú)論在任何一種瀏覽器上瀏覽網(wǎng)站,都能展現(xiàn)優(yōu)雅布局與設(shè)計(jì),從而大程度地提升瀏覽體驗(yàn)。創(chuàng)新互聯(lián)公司從事“晉安網(wǎng)站設(shè)計(jì)”,“晉安網(wǎng)站推廣”以來(lái),每個(gè)客戶項(xiàng)目都認(rèn)真落實(shí)執(zhí)行。
MySQL語(yǔ)句顯示數(shù)據(jù)庫(kù)或表:
show databases;//然后可以u(píng)se database_name;
show tables;
MySQL語(yǔ)句更改表名:
alter table table_name rename new_t;
MySQL語(yǔ)句添加列 :
alter table table_name add column c_n column attributes;
MySQL語(yǔ)句刪除列:
alter table table_name drop column c_n;
MySQL語(yǔ)句創(chuàng)建索引:
alter table c_table add index (c_n1,c_n2);
alter table c_table add unique index_name(c_n);
alter table c_table add primary key(sid);
MySQL語(yǔ)句刪除索引:
alter table c_table drop index c_n1;
MySQL語(yǔ)句更改列信息:
alter table t_table change c_1 c_1 varchar(200);
alter table t_table modify 1 c_1 varchar(200);
insert插入語(yǔ)句:
insert into table_name (c_1,c_2)
values ('x1',1);
update語(yǔ)句:
update table_name set c_1 =1 where c_2=3;
MySQL語(yǔ)句刪除數(shù)據(jù)庫(kù)或者表:
drop table table_name;
drop database database_name;//使用mysql_drop_db()可以刪除的.
名稱欄目:PHP中常用到的一些MySQL語(yǔ)句
網(wǎng)站路徑:http://www.dlmjj.cn/article/dphopig.html


咨詢
建站咨詢
