#!/usr/bin/python
import sqlite3
conn = sqlite3.connect("/home/michael/Dropbox/lagniappe/database.db")
cursor = conn.cursor()
query = raw_input('Search for a title:')
cursor.execute("SELECT * FROM nerd WHERE title LIKE '%?%';", query)
print cursor.fetchall()
Retuns the error:
michael@piplup:~$ python sqlite.py
Search for a title:test
Traceback (most recent call last):
File "sqlite.py", line 10, in <module>
cursor.execute("SELECT * FROM nerd WHERE title LIKE '%?%';", query)
sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 0, and there are 4 supplied.
All I want it to do is to print out the data it receives from the database to the console. Eventually I would like to manipulate this data, but I just need the query to work right.