Category Archives: Code

Code is a question and answer site for professional and enthusiast programmers.

How does the SQL injection from the "Bobby Tables" XKCD comic work?

Just looking at:

XKCD Strip
(Source: https://xkcd.com/327/)

What does this SQL do:

Robert'); DROP TABLE STUDENTS; --

I know both ' and -- are for comments, but doesn’t the word DROP get commented as well since it is part of the same line?

How does the SQL injection from the "Bobby Tables" XKCD comic work?