debug temp
This commit is contained in:
parent
8398abca7d
commit
d457fc76b8
7
db.go
7
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)*/
|
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) + ")")
|
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 {
|
if err != nil {
|
||||||
return id, err
|
return id, err
|
||||||
}
|
}
|
||||||
res, err := stmt.Exec()
|
res, err := stmt.Exec()
|
||||||
|
if err != nil {
|
||||||
|
return id, err
|
||||||
|
}
|
||||||
id, err = res.LastInsertId()
|
id, err = res.LastInsertId()
|
||||||
|
if err != nil {
|
||||||
|
return id, err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return id, err
|
return id, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user