我正在做一个简单的网页表单,但我尝试运行此代码它给了我一个错误我是新的python我不知道这个错误意味着什么,无法找到在线解决方案。这里是一个代码:
from flaskext.mysql import MySQL
from datetime import date
from dateutil import parser
mysql = MySQL()
app = Flask(__name__)
app.config['MYSQL_DATABASE_USER'] = 'mraghib'
app.config['MYSQL_DATABASE_PASSWORD'] = 'raghib10'
app.config['MYSQL_DATABASE_DB'] = 'fyp'
app.config['MYSQL_DATABASE_HOST'] = 'localhost'
mysql.init_app(app)
if __name__ == ("__main__"):
cursor = mysql.connect().cursor()
print(cursor.execute("select * from companylist"))
addcompanyList= ("INSERT INTO CompanyList (Ticker, CompanyName, SECP_Sector_Code, SectorName,OutstandingShares,DemoSheetName,Years) ""VALUES (%s, %s ,%int, %s,%int, %s, %s)")
datacompanyList = ("sdasd","adsda",142,"daasda",32,"sdadas",date(1977, 6, 14))
cursor.execute (addcompanyList,datacompanyList)
1条答案
按热度按时间roejwanj1#
试试这个: