SHARE
TWEET

Untitled

a guest Mar 17th, 2018 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. conn = sql.connect(host='xxxxxxx', user='xxx', password='xxx', database='db', charset="utf8")
  2.  
  3. cur = conn.cursor()
  4.  
  5. townQuery = (u"""SELECT * FROM Towns  WHERE Title like '%s' """)
  6. tqd = (u"%" +u"Серов"+u"%")
  7. cur.execute(townQuery, tqd)
  8.  
  9. for  i in cur:
  10.     print i
  11.    
  12. townQuery = u"""SELECT * FROM Towns  WHERE Title like %s"""
  13. tqd = [u"%Серов%"]
  14. cur.execute(townQuery, tqd)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top