Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- conn = sql.connect(host='xxxxxxx', user='xxx', password='xxx', database='db', charset="utf8")
- cur = conn.cursor()
- townQuery = (u"""SELECT * FROM Towns WHERE Title like '%s' """)
- tqd = (u"%" +u"Серов"+u"%")
- cur.execute(townQuery, tqd)
- for i in cur:
- print i
- townQuery = u"""SELECT * FROM Towns WHERE Title like %s"""
- tqd = [u"%Серов%"]
- cur.execute(townQuery, tqd)
Add Comment
Please, Sign In to add comment