I have wrote an instruction to fetch frequency from database using 2 id's as shown below:
cursor = db.cursor()
cursor.execute("select freq from matrix_brown where a_id in (%s) and b_id in (%s)",b_item_id,b_after_id)
b_freq=cursor.fetchone()
but i'm getting this error :
cursor.execute("select freq from matrix_brown where a_id in (%s) and b_id in (%s)",b_before_id,b_item_id)
TypeError: execute() takes at most 3 arguments (4 given)
pls help me out.. Thank you.. :)
asked Apr 1, 2011 at 18:33
Bhuvan raj
4133 gold badges8 silver badges17 bronze badges
2 Answers 2
If you want execute to fill in the string your calling it wrong:
cursor.execute("select freq from matrix_brown where a_id in (?) and b_id in (?)", (b_item_id,b_after_id))
answered Apr 1, 2011 at 18:38
AlG
15.3k4 gold badges43 silver badges54 bronze badges
Sign up to request clarification or add additional context in comments.
1 Comment
AlG
Glad to help! Please accept the answer if this solved the problem for you. :)
cursor.execute("select freq from matrix_brown where a_id in (%s) and b_id in (%s)",(b_item_id,b_after_id))
answered Apr 1, 2011 at 18:41
Clodoaldo Neto
127k30 gold badges251 silver badges274 bronze badges
Comments
default