diff --git a/database/sqlite/database.go b/database/sqlite/database.go index a575481..16b45be 100644 --- a/database/sqlite/database.go +++ b/database/sqlite/database.go @@ -212,9 +212,9 @@ func (d *SQLiteDatabase) EditEntry(entry *guestbook.Entry) error { } defer tx.Rollback() - row := tx.Stmt(stmtUpdateEntry).QueryRow(entry.Name, entry.Message, entry.Website, entry.HideWebsite, entry.ID) - if row.Err() != nil { - return row.Err() + _, err = tx.Stmt(stmtUpdateEntry).Exec(entry.Name, entry.Message, entry.Website, entry.HideWebsite, entry.ID) + if err != nil { + return err } tx.Commit() @@ -261,9 +261,9 @@ func (d *SQLiteDatabase) EditReply(reply *guestbook.Reply) error { } defer tx.Rollback() - row := tx.Stmt(stmtUpdateReply).QueryRow(reply.Message, reply.ID) - if row.Err() != nil { - return row.Err() + _, err = tx.Stmt(stmtUpdateReply).Exec(reply.Message, reply.ID) + if err != nil { + return err } tx.Commit()