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

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


咨詢
建站咨詢
