From 0beb97d67db834c44b5aa321fbe4573c96b28d6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?GOLDERWEB=20=E2=80=93=20Jonathan=20Golder?= Date: Mon, 7 Sep 2015 16:21:57 +0200 Subject: [PATCH] Use qmark parametrization style for mysql query --- mysql_red.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mysql_red.py b/mysql_red.py index 616ac3e..144e7ef 100644 --- a/mysql_red.py +++ b/mysql_red.py @@ -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: