On Sun, 2006-01-22 at 12:43 +0000, John Joseph wrote:
> Hi
Hi John...
Most of your problems in your code seems to be caused by a single
mistake. Compare the following two strings and you should figure out
what's wrong by yourself:
email_id = '[EMAIL PROTECTED]'
wrong_string = '''SELECT s FROM t WHERE id=%s''' , (email_id)
right_string = '''SELECT s FROM t WHERE id=%s''' % (email_id)
print "Wrong:", wrong_string
print "Right:", right_string
This is the output:
Wrong: ('SELECT s FROM t WHERE id=%s', '[EMAIL PROTECTED]')
Right: SELECT s FROM t WHERE [EMAIL PROTECTED]
Now, which one is the right one? And which one is the one you want?
I suggest you study strings more, especially concatenation and '%'.
If you need more help, just post to the mailing list again.
Ziyad.
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor