到目前为止,这是我的代码。No results found如果MySQL没有返回结果,我正在尝试打印,但是我无法弄清楚。也许我使用了不正确的参数。谁能给我一个例子?非常感激!
def movie_function(film):
connection = mysql connection info
cursor = connection.cursor()
sql = "SELECT * FROM film_database WHERE film_name = '"+film+"' ORDER BY actor"
cursor.execute(sql)
rows = cursor.fetchall()
for row in rows:
print row[1]
Run Code Online (Sandbox Code Playgroud)