Background-4 增删改函数介绍

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

增加一行数据。Insert

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

简单举例

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

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

 

删除

2.删数据:  

delete from 表名;  

delete from 表名 where id=1;  

删除结构:  

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

删除表:drop table 表名;  

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

 

简单举例:

delete from users where id=16

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

 

修改

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

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

 

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

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

相关文章:

  • 2021-12-10
  • 2021-10-23
  • 2021-11-16
  • 2021-09-01
  • 2021-09-22
  • 2021-09-22
  • 2021-12-12
  • 2021-11-28
猜你喜欢
  • 2022-01-30
  • 2021-08-29
  • 2022-01-20
  • 2021-12-11
  • 2021-12-17
  • 2021-11-22
  • 2021-11-04
相关资源
相似解决方案