File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
ClassExamples/PJ128_AIML6m_Jan21/flask/flaskSQLite_4_addViewModifyDelete Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ def update1():
26
26
con = sqlite3 .connect ("employee.db" )
27
27
con .row_factory = sqlite3 .Row
28
28
cur = con .cursor ()
29
- cur .execute ("select * from students where id=?" ,id )
29
+ cur .execute ("select * from students where id=?" ,( id ,) )
30
30
rows = cur .fetchall ()
31
31
return render_template ("update1.html" ,rows = rows )
32
32
@@ -101,7 +101,7 @@ def deleterecord():
101
101
with sqlite3 .connect ("employee.db" ) as con :
102
102
try :
103
103
cur = con .cursor ()
104
- cur .execute ("delete from students where id = ?" ,id )
104
+ cur .execute ("delete from students where id = ?" ,( id ,) )
105
105
msg = "record successfully deleted"
106
106
except :
107
107
msg = "can't be deleted"
You can’t perform that action at this time.
0 commit comments