summaryrefslogtreecommitdiff
path: root/option.go
diff options
context:
space:
mode:
Diffstat (limited to 'option.go')
-rw-r--r--option.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/option.go b/option.go
index 0b41e0a..dd3055d 100644
--- a/option.go
+++ b/option.go
@@ -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)