所以我有这个查询
SELECT COUNT(b.user_ticket_id) as tiketscount
FROM event_tickets a
INNER JOIN user_tickets b ON a.event_ticket_id = b.event_ticket_id
WHERE b.status = 'used' AND a.event_id = '1'
这给了我预期的结果(count = 1),我决定尝试下面的代码查询
SELECT COUNT(b.user_ticket_id) as tiketscount
FROM event_tickets a
INNER JOIN user_tickets b ON a.event_ticket_id = b.event_ticket_id
WHERE b.status = 'used' AND a.event_id = '1 DROP TABLE contact "1=1"'
我得到了与以前相同的结果,但是当我将一个更改为 2 时,如下所示,没有结果,mysql 是否有可能使用它找到的第一个字符?
SELECT COUNT(b.user_ticket_id) as tiketscount
FROM event_tickets a
INNER JOIN user_tickets b ON a.event_ticket_id = b.event_ticket_id
WHERE b.status = 'used' AND a.event_id = '2 DROP TABLE contact "1=1"'
任何人都知道为什么这是可能的?谢谢
我正在使用 MYSQL 5.5.30 InnoDB