当前位置:网站首页>如何让数据库中的数据同步
如何让数据库中的数据同步
2022-08-10 01:20:00 【CSDN问答】
查询出来的数据能打印出来,数据库中的数据却没变化,怎么改
def select_now():
s1 = ey1.get()
if s1 != '':
conn = pymssql.connect('', 'sa', '', 'table')
cursor = conn.cursor()
sql_select = "SELECT * FROM [table].[dbo].[Table2] WHERE province=%s "
data=s1
cursor.execute(sql_select,data)
results=cursor.fetchall()
print(results)
cursor.close()
conn.close()
for i in map(treeview.delete, treeview.get_children("")):
pass
for i in range(min(len(province), len(area), len(number))): # 写入数据
treeview.insert('', i, values=(province[i], area[i], number[i]))
数据库的数据
1 河南 郑州 1
2 河北 石家庄 2
3 浙江 杭州 3
4 四川 重庆 4
14 湖北 武汉
打印出来的数据
[(1, '河南 ', '郑州 ', '1 ')]
边栏推荐
猜你喜欢
随机推荐
商业模式及其 SubDAO 深入研究
Solve the problem of sed replacement text containing special characters such as "/" and "#"
OpenSSF的开源软件风险评估工具:Scorecards
阿里云OSS文件上传
GB28181 sip和RTSP(Real-Time Streaming Protocol)实时流控制协议
惊掉你下巴,程序员编码竟然可以被 996 指数化
这一次,话筒给你:向自由软件之父 Richard M. Stallman 提问啦!
[语法糖] 关于类别字符串到类别数字id的映射
【SSRF漏洞】实战演示 超详细讲解
CMake 编译运行dpdk项目程序
组件的使用
grafana9配置邮箱告警
The shell specifies the parameter name to pass the parameter
首次在我们的centos登录我们的Mysql
Shader Graph learns various special effects cases
Initial attempt at UI traversal
微透镜阵列后光传播的研究
小程序实现搜索功能续
ITK编译remote库
实操|风控模型中常用的这三种预测方法与多分类场景的实现