Hi guys,

I am having trouble getting multiple LIKE statements to work using
cursor.execute(SQL, [params]).

Here is my raw SQL query which I have confirmed is working directly at
the mysql command line:

"SELECT  samples.number from samples WHERE samples.description LIKE
samples.description LIKE %ultraviolet% OR samples.title LIKE
%ultraviolet%"

When I try to use cursor.execute() I am getting no matches.

I am trying to construct the query above programmatically.  Must I use
the query param?  I know in the docs it states that it expects a
placeholder, but I don't want to use one.  I have successfully
constructed the full query programmatically but that apparently
doesn't work and I don't know why.  I use:

cursor.execute("SELECT samples.number FROM samples WHERE %s",[query])

query = "samples.description LIKE samples.description LIKE %ultraviolet
% OR samples.title LIKE %ultraviolet%"

I'd really appreciate some help.  Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to