Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[Blog] INSERT INTO ? VALUE ?
#!/usr/bin/env python
#coding=utf8
import MySQLdb
conn = MySQLdb.connect(host='localhost', user='root', passwd='', db='test')
cu = conn.cursor()
text = "문자열"
print(text)
try:
cu.execute("INSERT INTO test_table (text_fields) VALUE (%s)", (text))
except MySQLdb.Error, e:
print e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.