diff --git a/main.go b/main.go index 6e165d5..106db55 100644 --- a/main.go +++ b/main.go @@ -6,6 +6,7 @@ import ( "encoding/json" "errors" "flag" + "fmt" "github.com/elliotchance/phpserialize" _ "github.com/go-sql-driver/mysql" "log" @@ -124,7 +125,8 @@ func loadDbEntries(ot string, id int64) map[string]metadataValues { log.Printf("Invalid object type: %s", ot) return entries } - rows,err:=db.Query("select meta_key, meta_value from $1 where $2 = $3", table, column, id) + query:=fmt.Sprintf("select meta_key, meta_value from %s where ? = ?", table) + rows,err:=db.Query(query, column, id) if err != nil { log.Printf("db.Query: %s\n", err.Error()) return entries