import pymysql
ecshop=pymysql.connect('localhost','root','root','ecshop')
curs=ecshop.cursor()
sql="select consignee,email,tel from ecs_user_address where address_id>3 "
try:
curs.execute(sql)
a=curs.fetchall() #接收全部的返回结果;
print(a)
for i in a:
print(i)
except:
print('wrong')
ecshop.close()

python3 根据条件查询mysql数据库中数据;

相关文章:

  • 2022-12-23
  • 2021-08-01
  • 2022-02-01
  • 2021-06-18
  • 2021-11-19
  • 2021-07-26
  • 2021-04-08
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-28
  • 2022-12-23
  • 2021-06-07
  • 2022-12-23
相关资源
相似解决方案