db question

B

bruce

update...

in using the mysql_query log function, i get the following query being
registered:

select * from foo where dog like "%'small'%"

so.. if i can figure out how to get rid of the "'" inside the "%" the query
should/will work...

thanks




Hi...

simple test

mysql cmd - select * from foo where dog like "%small%";

sql ="""select * from foo where dog like "%%%s%%" """
c.execute(sql, (var,))


the above doesn't work, and I can't seem to figure out how to display/print
out the sql as i't actually been excuted, so I can see where the issue is.

i've tried to "/" escape, as well as a few other things, now of which shed
any light on the issue. haven't found any information via google either.

the above works if i have something like
sql="""select * from foo where dog=%s"""
c.execute(sql,(var,))

so.. any help/pointers on what i've screwed up/missed would be helpful.

thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top