一、Insert(增)
舉例說明:
我們新增一個賬號密碼:
insert into users value('15','test','test');
當然,是需要你按照列來新增的,數據類型也需要是列的同一數據類型,如何查看類的類型呢?使用desc 表名即可,可以看出來,id為主鍵:
desc users;
二、delete(刪)
刪數據: delete from 表名; delete from 表名 where id=1; 刪除結構: 刪數據庫:drop database 數據庫名; 刪除表:drop table 表名; 刪除表中的列:alter table 表名 drop column 列名
delete from users where id=15;
在注入中不要輕易使用這條命令!!!由於比較危險,其他刪除語句不作演示。
三、update(改)
修改所有:
updata 表名 set 列名='新的值,非數字加單引號';
帶條件的修改:
updata 表名 set 列名='新的值,非數字加單引號' where id=6;
一起動手試試吧:
update users set username='pipi' where id=15;
四、select(查)
相信這條語句大家都不陌生,舉個栗子就結束這里的增刪改查語法說明:
select username from users where id=15;
