[Tutor] Searching for email id in MySQL giving wrong results
Alan Gauld
alan.gauld at freenet.co.uk
Mon Jan 23 20:46:29 CET 2006
>> >> wrong_string = '''SELECT s FROM t WHERE id=%s''' , (email_id)
>> >
>> The OP must replace the comma with a % character for the string
>> substitution to take place.
>
> The wrong_string line was lifted from the following code in the OP.
>
> entry = db.cursor()
> entry.execute("""SELECT * FROM contact WHERE email_id = %s""",
> (s_email,))
>
Ah I see. Yes that's a different proposition entirely!
I really should read the whole thread before jumping in... :-(
Alan G.
More information about the Tutor
mailing list