← Quiz: SQL Injection: all 10 questions
Quiz: SQL Injection · Question 1 of 10
Why did the username admin' -- log in without a password?
Why did the username admin' -- log in without a password?
- A.SQLite ignores passwords
- B.The quote closed the string and -- commented out the password check
- C.The admin had no password
- D.UNION merged the tables
Answer & explanation
Correct answer: The quote closed the string and -- commented out the password check
The input changed the query's structure: everything after -- became a comment, so only username = 'admin' was checked.
Can you get the rest right without peeking?
Take the timed Quiz: SQL Injection quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →