Use qmark parametrization style for mysql query

This commit is contained in:
2015-09-07 16:21:57 +02:00
parent 773557a591
commit 0beb97d67d

View File

@@ -48,10 +48,7 @@ class MYSQL_RED_PAGE( MYSQL_RED ):
"""
cursor = type( self ).connection.cursor(mysqldb.DictCursor)
format_str = """SELECT * FROM `red_pages` WHERE page_id={page_id};"""
query = format_str.format( page_id=int( page_id ) )
cursor.execute( query )
cursor.execute( 'SELECT * FROM `red_pages` WHERE `page_id` = ?;', ( page_id, ) )
res = cursor.fetchone()
if res: