Skip to content

Instantly share code, notes, and snippets.

@johnpena
Created October 30, 2013 17:05
Show Gist options
  • Select an option

  • Save johnpena/7236260 to your computer and use it in GitHub Desktop.

Select an option

Save johnpena/7236260 to your computer and use it in GitHub Desktop.
def get_user_from_db(username):
statement = "SELECT * FROM users WHERE name ='" + username + "';"
cursor.execute(statement)
return cursor.fetchall()[0]
get_user_from_db("'; DROP TABLE users; '")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment