import sqlite3
conn = sqlite3.connect("/var/lib/grafana/grafana.db") # 连接数据库
cursor = conn.cursor() # 创建游标
cursor.execute("select id from user where name = '%s'"% user_name) # 执行语句
user_id = cursor.fetchall() # 拿到结果
import sqlite3
conn = sqlite3.connect("/var/lib/grafana/grafana.db") # 连接数据库
cursor = conn.cursor() # 创建游标
cursor.execute("select id from user where name = '%s'"% user_name) # 执行语句
user_id = cursor.fetchall() # 拿到结果
1797
1万+
9930
1861
1224
1496
1448

被折叠的 条评论
为什么被折叠?
