关于MySQLdb
import MySQLdb
db = MySQLdb.connect(host = 'localhost', user = 'root', passwd = '?????', db = 'test')
cursor = db.cursor()
cursor.execute('select * from cb_table')
rs = cursor.fetchall()
print rs
"""
如果我把
cursor = db.cursor()
cursor.execute('select * from cb_table')
改为
db.cursor().execute('select * from callback_table')
就会报ProgrammingError: execute() first错误为什么呢
"""