客户需求
使用Python脚本实现对对Mysql数据库的增删改查
import pymysql
# 显示
def readTable(cursor):
# 选择全部
cursor.execute("select * from premoney")
# 获得返回值,返回多条记录,若没有结果则返回()
results = cursor.fetchall()
# 遍历打印
for row in results:
salesman = row[0]
shool = row[1]
admoney = row[2]
print(salesman, shool,admoney, '\n')
print("successfully show table"