Use Python variable in a MySQL Subquery

zack2006

New Member
\[code\]team = input("Enter the team name: ")cursor = db.cursor()sql = "SELECT * FROM `flash_data_archive` WHERE `event_id` IN (SELECT `alternate_id` from `event_list` where `category` = %s)" % team cursor.execute(sql)\[/code\]What is the correct notation to have the the string the user entered for 'team' to be used for the category field in the sql subsuery?
 
Top