Hey i read all the guides there is with python and yet i couldnt find a solution for the next Query:
select * from known_table_name where id in (list)
list is a variable that holds = "1,2,3,56,7,8"
Does anyone knows how to secure it?
Hey i read all the guides there is with python and yet i couldnt find a solution for the next Query:
select * from known_table_name where id in (list)
list is a variable that holds = "1,2,3,56,7,8"
Does anyone knows how to secure it?
There are various ways, including:
# SAFE EXAMPLES. DO THIS!
cursor.execute("SELECT admin FROM users WHERE username = %s'", (username, ));
cursor.execute("SELECT admin FROM users WHERE username = %(username)s", {'username': username});