import pymysql
import time
import datetime
-sharp
db = pymysql.connect("localhost","root","aaaaaa","getlist" )
cursor = db.cursor()
sql="INSERT INTO t_mall VALUES (0,%s,%s,%s)"
try:
-sharp SQL
cursor.execute(sql % ("http://baidu.com", "", ""))
-sharp
db.commit()
except:
-sharp
db.rollback()
-sharp
db.close()
No error message is displayed during execution, but the data is not inserted. What is the reason?