IT猫扑网:您身边最放心的安全下载站! 最新更新| 软件分类| 专题汇总| 手机版

您当前所在位置:IT猫扑网 > 网络编程 > PHP编程 > PHP中常用的几个 mysql 语句

PHP中常用的几个 mysql 语句

时间:2015-06-28 00:00 来源:IT猫扑网|http://www.itmop.com/ 作者:网管联盟 我要评论(0)

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()可以删除的.

关键词标签:语句,常用,table 

相关阅读 2021年最好用的10款php开发工具推荐 plsql developer怎么连接数据库-plsql developer连接数据库方法 php利用淘宝IP库获取用户ip地理位置 在 PHP 中使用命令行工具 php出现Cannot modify header information问题的解决方法大全 详解ucenter原理及第三方应用程序整合思路、方法

文章评论
发表评论

热门文章 2021年最好用的10款php开发工具推荐 2021年最好用的10款php开发工具推荐 plsql developer怎么连接数据库-plsql developer连接数据库方法 plsql developer怎么连接数据库-plsql developer连接数据库方法 在 PHP 中使用命令行工具 在 PHP 中使用命令行工具 php应用程序安全防范技术研究 php应用程序安全防范技术研究 关于php curl获取301或302转向的网址问题 关于php curl获取301或302转向的网址问题

相关下载

人气排行 详解ucenter原理及第三方应用程序整合思路、方法 plsql developer怎么连接数据库-plsql developer连接数据库方法 PHP中防止SQL注入攻击 PHP会话Session的具体使用方法解析 PHP运行出现Notice : Use of undefined constant 的解决办法 PHP如何清空mySQL数据库 CakePHP程序员必须知道的21条技巧 PHP采集图片实例(PHP采集) 完美解决failed to open stream: HTTP request failed! <? phpinfo() ?>无法执行的解决办法 2021年最好用的10款php开发工具推荐 用header或meta实现PHP页面编码的区别