From d457fc76b8038f4f24b7bcf1cb150c09ffbcad44 Mon Sep 17 00:00:00 2001 From: ycc Date: Tue, 26 Sep 2023 16:27:07 +0200 Subject: [PATCH] debug temp --- db.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/db.go b/db.go index 2df4591..479807b 100755 --- a/db.go +++ b/db.go @@ -476,11 +476,18 @@ func (t *TableInfo) Insert(record AssRow) (int64, error) { } err = t.db.conn.QueryRow("SELECT LAST_INSERT_ID()").Scan(&id)*/ stmt, err := t.db.conn.Prepare("INSERT INTO " + t.Name + "(" + removeLastChar(columns) + ") VALUES (" + removeLastChar(values) + ")") + fmt.Println("INSERT INTO " + t.Name + "(" + removeLastChar(columns) + ") VALUES (" + removeLastChar(values) + ")") if err != nil { return id, err } res, err := stmt.Exec() + if err != nil { + return id, err + } id, err = res.LastInsertId() + if err != nil { + return id, err + } } return id, err }