sqlite占位符的事例

import sqlite3
class Demo01:
def __init__(self):
self.conn=sqlite3.connect("sql_demo_001.db")
self.cursor1=self.conn.cursor()
self.cursor1.execute("select * from table_001 where name= ? and id= ? ",('ssss',31))
print(self.cursor1.fetchall())
self.conn.commit()
self.conn.close()
d=Demo01()




posted @ 2019-04-25 09:22  玄空2  阅读(861)  评论(0编辑  收藏  举报