Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gallery-service/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,13 @@ func (g *Gallery) Create(profile *OctoProfile) error {
func (g Gallery) Update(profile *OctoProfile) error {
db := GetDb()

stmt, err := db.Prepare(fmt.Sprintf("UPDATE gallery SET title = '%s', description = '%s' WHERE id = %d and login = '%s'", g.Title, g.Description, g.ID, profile.Login))
stmt, err := db.Prepare("UPDATE gallery SET title = ?, description = ? WHERE id = ? and login = ?")
if err != nil {
return err
}
defer stmt.Close()

r , err := stmt.Exec()
r , err := stmt.Exec(g.Title, g.Description, g.ID, profile.Login)
if err != nil {
return err
}
Expand Down
Loading