MYSQL注入天书之数据库增删改介绍

Background-4 增删改函数介绍

在对数据进行处理上,我们经常用到的是增删查改。接下来我们讲解一下mysql 的增删改。查就是我们上述总用到的select,这里就介绍了。

增加一行数据。Insert

简单举例

insert into users values('16','lcamry','lcamry');

 

删除

2.删数据:  

delete from 表名;  

delete from 表名 where id=1;  

删除结构:  

删数据库:drop database 数据库名;  

删除表:drop table 表名;  

删除表中的列:alter table 表名 drop column 列名; 

 

简单举例:

delete from users where id=16

 

修改

修改所有:updata 表名 set 列名='新的值,非数字加单引号' ;  

带条件的修改:updata 表名 set 列名='新的值,非数字加单引号' where id=6;  

 

update users set username='tt' where id=15

posted @ 2016-08-11 22:43  lcamry  阅读(857)  评论(0编辑  收藏  举报