2020
10-05
10-05
Python flask框架实现查询数据库并显示数据
首先数据库长这样我们想将name和age列显示到web页面上代码sqlshowweb.pyfromflaskimportFlaskfromflaskimportrender_templateimportpymysqlapp=Flask(__name__)@app.route('/')defindex():conn=pymysql.connect(host='39.106.168.84',user='flask_topvj_net',password='xxxxxxxx',port=3306,db='flask_topvj_net')cur=conn.cursor()sql="SELECT`name`,`age`FROM`student`WHERE1"cur....
继续阅读 >