0

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

2 Answers 2

1

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
Sign up to request clarification or add additional context in comments.

1 Comment

Glad to help! Please accept the answer if this solved the problem for you. :)
0
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

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.