Last active
August 29, 2015 14:05
-
-
Save michaeljs1990/934496ef95c11609cc42 to your computer and use it in GitHub Desktop.
Python Sqlite3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 | |
#python 3.4 | |
# This fails with key of site_title | |
db.execute("SELECT * FROM options WHERE key=?;", (key.encode('utf-8'),)) | |
# This works... | |
db.execute("SELECT * FROM options WHERE key='site_title';") | |
# This says I have supplied to many arguments... | |
db.execute("SELECT * FROM options WHERE key='?';", (key.encode('utf-8'),)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Error from first output when i try and access it using fetchone()[0]
repr output of key 'site_title'