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

首頁 > 數(shù)據(jù)庫 > MySQL > 正文

PHP常用MySql操作

2024-07-24 12:35:32
字體:
供稿:網(wǎng)友
  PHP中常用的幾個(gè) mysql 語句
 
  顯示數(shù)據(jù)庫或表:
 
  show databases;//然后可以u(píng)se 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;
 
  創(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);
 
  刪除索引:
 
  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;
 
  刪除數(shù)據(jù)庫或者表:
 
  drop table table_name;
 
  drop database database_name;//使用mysql_drop_db()可以刪除的.

(編輯:武林網(wǎng))

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 丰原市| 沈丘县| 吐鲁番市| 洱源县| 潞西市| 连城县| 玛曲县| 海宁市| 威远县| 湖北省| 陇南市| 延吉市| 清镇市| 承德县| 奈曼旗| 翁牛特旗| 宁晋县| 吕梁市| 曲水县| 章丘市| 新民市| 太仆寺旗| 彰化市| 固镇县| 景谷| 新龙县| 怀化市| 固阳县| 乐陵市| 吴川市| 荣昌县| 曲松县| 乌恰县| 车险| 繁峙县| 多伦县| 福州市| 靖州| 吉安市| 麻江县| 体育|