ここで何が問題なのかわかりません。私が取得し続けるエラーコードは「文字列のフォーマット中の引数の数が間違っています」ですが、個人的には何も問題はありません。誰かが私を正しい方向に向けることができますか? ありがとう。
def film_function(number, film):
connection = connect(host='localhost', user='root', \
passwd='', db='survey')
cursor = connection.cursor()
sql = "SELECT * FROM persons, persons_films WHERE persons.person = persons_films.person AND number_of_films >= %s AND film = '%s' ORDER BY persons_films.person"
cursor.execute(sql, [number], [film])
rows = cursor.fetchall()
if not rows:
print ("No one in "+film+" found!")
else:
for row in rows:
print row[0],"-", row[1]
cursor.close()
connection.close()