Skip to content

Commit 13f1f06

Browse files
committed
update
1 parent 2f4048e commit 13f1f06

File tree

2 files changed

+2
-2
lines changed
  • ClassExamples/PJ128_AIML6m_Jan21/flask/flaskSQLite_4_addViewModifyDelete

2 files changed

+2
-2
lines changed

ClassExamples/PJ128_AIML6m_Jan21/flask/flaskSQLite_4_addViewModifyDelete/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def update1():
2626
con = sqlite3.connect("employee.db")
2727
con.row_factory = sqlite3.Row
2828
cur = con.cursor()
29-
cur.execute("select * from students where id=?",id )
29+
cur.execute("select * from students where id=?",(id,) )
3030
rows = cur.fetchall()
3131
return render_template("update1.html",rows = rows)
3232

@@ -101,7 +101,7 @@ def deleterecord():
101101
with sqlite3.connect("employee.db") as con:
102102
try:
103103
cur = con.cursor()
104-
cur.execute("delete from students where id = ?",id)
104+
cur.execute("delete from students where id = ?",(id,))
105105
msg = "record successfully deleted"
106106
except:
107107
msg = "can't be deleted"

0 commit comments

Comments
 (0)