Browse Source

photo db name falsch

pull/1/head
Georg Spar 1 year ago
parent
commit
c8e0348f01
  1. 4
      wdmdb.go

4
wdmdb.go

@ -112,7 +112,7 @@ func CreatePhoto(pho Photos) (resPhoto Photos, err error) {
log.Println("Verbindung hergestellt (Photo CREATE)")
log.Println("Name = ", pho.Pfad)
defer conn.Close()
res, err := conn.Exec("INSERT INTO photo VALUES(?,?,?,?)", pho.Id, pho.Pfad, pho.ItembId, pho.ItemextId)
res, err := conn.Exec("INSERT INTO photos VALUES(?,?,?,?)", pho.Id, pho.Pfad, pho.ItembId, pho.ItemextId)
if err != nil {
log.Println("Error while executing insert statement", err)
}
@ -129,7 +129,7 @@ func DeletePhoto(phoId uint64) (result, err error) {
}
log.Println("DB Verbindung hergestellt (Photo DELETE)")
defer conn.Close()
_, err = conn.Exec("DELETE FROM photo WHERE id = ?", phoId)
_, err = conn.Exec("DELETE FROM photos WHERE id = ?", phoId)
if err != nil {
log.Fatal("Error while executing DELETE statement", err)
}

Loading…
Cancel
Save