国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數據庫 > MySQL > 正文

PHP常用MySql操作

2024-07-24 12:36:31
字體:
來源:轉載
供稿:網友

PHP中常用的幾個 mysql 語句

顯示數據庫或表:

show databases;//然后可以use database_name;

show tables;

更改表名:

alter table table_name rename new_t;

添加列 :

alter table table_name add column c_n column attributes;

刪除列:

alter table table_name drop column c_n;

創建索引:

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);

刪除索引:

alter table c_table drop index c_n1;

更改列信息:

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;

刪除數據庫或者表:

drop table table_name;

drop database database_name;//使用mysql_drop_db()可以刪除的.

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 水富县| 阳新县| 冕宁县| 宜昌市| 宝丰县| 达日县| 潮安县| 邓州市| 新昌县| 蒙自县| 磐安县| 永州市| 通许县| 广宁县| 揭西县| 宁安市| 合山市| 武宁县| 磐安县| 景泰县| 元阳县| 涿鹿县| 新邵县| 赤城县| 安多县| 杭锦旗| 任丘市| 东阿县| 霍城县| 社会| 延寿县| 辰溪县| 漳州市| 武宁县| 宿迁市| 乌鲁木齐县| 尉氏县| 吉木乃县| 千阳县| 石柱| 阿鲁科尔沁旗|