> I am trying to search and display the results , even
> if we give a part of the email_id
>entry.execute("""SELECT * FROM contact WHERE
> email_id = %s """, (s_email,))
If you want to do partial matches you will need to use LIKE
'''
SELECT * FROM contact
WHERE email_id LIKE %s
'
--- Danny Yoo <[EMAIL PROTECTED]> wrote:
> > the email id which starts with j is
> > select * from contact where email_id like 'j%';
>
> Hi John,
>
> Ok, looks good so far. So in a Python program, we
> might try something
> like this:
>
>
##
> the email id which starts with “j” is
> select * from contact where email_id like 'j%';
Hi John,
Ok, looks good so far. So in a Python program, we might try something
like this:
##
## assuming cursor is set u
--- Danny Yoo <[EMAIL PROTECTED]> wrote:
>
> Hi John,
>
> Ok; because the question you're asking looks a
> little homework-y, we have
> to be a little bit more cautious in our answers.
> What part are you
> getting stuck on?
>
>
> Do you understand how SQL wildcards work? There's a
> good n
On Sun, 29 Jan 2006, John Joseph wrote:
>I am sending the code of the function "searchbyemail" and the output
>of the program when I run I am trying to search and display the
>results , even if we give a part of the email_id
Hi John,
Ok; because the question you're asking looks a l
Hi
I am sending the code of the function
"searchbyemail" and the output of the program when I
run
I am trying to search and display the results , even
if we give a part of the email_id
thanks
Joseph John
SEARCH by email _id functi
John Joseph wrote:
> Hi
>Thanks to Allan,Danny,Pujo
>I did my simple python script for MySQL , the
> scripts add the data , and search for the data and
> display
> I have problem in searching email id ,ie
> If search for the [EMAIL PROTECTED] , I will not get any
> r
Hi Ziyad,
Don't beat yourself up over this, you were trying to be helpful
and that's a good thing. The original syntax looked weird to me too,
but mainly because the variable was inside a pair of parens, but
because I didn't know MySql I didn't say anything at the time.
But your answer seemed rea
On Mon, 2006-01-23 at 14:00 -0500, Python wrote:
> 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,))
>
> The execute method will handle the string substitution
On Mon, 2006-01-23 at 19:46 +, Alan Gauld wrote:
> >> >> 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
>> >> 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.ex
On Mon, 2006-01-23 at 18:17 +, Alan Gauld wrote:
> > On Sun, 2006-01-22 at 21:23 +0300, ZIYAD A. M. AL-BATLY wrote:
> >> wrong_string = '''SELECT s FROM t WHERE id=%s''' , (email_id)
> >
> > The string is being used in a call to cursor.execute. The email_id is a
> > second parameter g
On Mon, 2006-01-23 at 18:17 +, Alan Gauld wrote:
> > On Sun, 2006-01-22 at 21:23 +0300, ZIYAD A. M. AL-BATLY wrote:
> >> wrong_string = '''SELECT s FROM t WHERE id=%s''' , (email_id)
> >
> > The string is being used in a call to cursor.execute. The email_id is a
> > second parameter g
> On Sun, 2006-01-22 at 21:23 +0300, ZIYAD A. M. AL-BATLY wrote:
>> wrong_string = '''SELECT s FROM t WHERE id=%s''' , (email_id)
>
> The string is being used in a call to cursor.execute. The email_id is a
> second parameter getting passed to execute. That is the *correct*
> approach to
On Sun, 2006-01-22 at 21:23 +0300, ZIYAD A. M. AL-BATLY wrote:
> wrong_string = '''SELECT s FROM t WHERE id=%s''' , (email_id)
The string is being used in a call to cursor.execute. The email_id is a
second parameter getting passed to execute. That is the *correct*
approach to use.
That
Hi
Thanks for the tip
now I am trying to do pattern matching for MySQL , but
I am not getting the result
on MySQL , to select for all email starting with
jos we do
select * from contact where email_id like "jos%";
but I get confused how to use it , while executing
it in python , how to
On Sun, 2006-01-22 at 12:43 +, 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_s
Hi
Thanks to Allan,Danny,Pujo
I did my simple python script for MySQL , the
scripts add the data , and search for the data and
display
I have problem in searching email id ,ie
If search for the [EMAIL PROTECTED] , I will not get any
result , Guidance and advice needed
18 matches
Mail list logo