From 4a6840fd2f4bb1f947429308c9905c1a380e2219 Mon Sep 17 00:00:00 2001 From: ycc Date: Wed, 5 Jul 2023 14:18:44 +0200 Subject: [PATCH] bugfix insert lastid in mysql --- db.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db.go b/db.go index c0f4e85..6ef4f89 100755 --- a/db.go +++ b/db.go @@ -484,7 +484,7 @@ func (t *TableInfo) Insert(record AssRow) (int, error) { if err != nil { return id, err } - err = t.db.conn.QueryRow("LAST_INSERT_ID();").Scan(&id) + err = t.db.conn.QueryRow("SELECT LAST_INSERT_ID();").Scan(&id) } return id, err }