I have the following code in a client supplied block:
$user = $_POST['user'];
$sql = "SELECT * FROM users WHERE user = '" . $user . "'";
$dbh->query($sql);
Also, this code doesn't echo anything out to the screen currently, so it doesn't help me if I select multiple users. That doesn't visually show the client anything.
It's obvious to me that this is prone to injection, but I can't find a way to show the client how this would work. I tried dropping the table, but the ->query()
seems to only allow one statement at a time.
Here's what I've tried so far
' OR 1=1; DROP TABLE users; SELECT * FROM users WHERE 1='1
but that doesn't work.