Use qmark parametrization style for mysql query
This commit is contained in:
@@ -48,10 +48,7 @@ class MYSQL_RED_PAGE( MYSQL_RED ):
|
|||||||
"""
|
"""
|
||||||
cursor = type( self ).connection.cursor(mysqldb.DictCursor)
|
cursor = type( self ).connection.cursor(mysqldb.DictCursor)
|
||||||
|
|
||||||
format_str = """SELECT * FROM `red_pages` WHERE page_id={page_id};"""
|
cursor.execute( 'SELECT * FROM `red_pages` WHERE `page_id` = ?;', ( page_id, ) )
|
||||||
query = format_str.format( page_id=int( page_id ) )
|
|
||||||
|
|
||||||
cursor.execute( query )
|
|
||||||
res = cursor.fetchone()
|
res = cursor.fetchone()
|
||||||
|
|
||||||
if res:
|
if res:
|
||||||
|
|||||||
Reference in New Issue
Block a user