diff options
Diffstat (limited to 'option.go')
-rw-r--r-- | option.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -10,10 +10,10 @@ type Option struct { numVotes int64 } -func getOptionFromText(db*sqlite3.Conn, text string) (Option, error) { +func getOptionFromText(db*sqlite3.Conn, text string, id int) (Option, error) { - args := sqlite3.NamedArgs{"$a": text} - sql := "SELECT * FROM options WHERE text = $a" + args := sqlite3.NamedArgs{"$a": text, "$b": id} + sql := "SELECT * FROM options WHERE text = $a and poll_id = $b" s, err := db.Query(sql, args) row := make(sqlite3.RowMap) |