提交 1abcd4f4 编写于 作者: 片刻小哥哥's avatar 片刻小哥哥

优化mysql链接方式

上级 366a83b2
......@@ -2,6 +2,10 @@
__pycache__/
*.py[cod]
*$py.class
*.csv
*.xlsx
*.txt
*.mp3
# C extensions
*.so
......
......@@ -69,7 +69,7 @@ class MySQL:
try:
self.open()
self.cur.execute("%s;" % sql, L)
self.cur.fetchall()
result = self.cur.fetchall()
print("ok")
msg = "success"
except Exception as e:
......@@ -80,4 +80,4 @@ class MySQL:
finally:
self.close()
# 返回统一状态
return msg
\ No newline at end of file
return result, msg
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册