This commit is contained in:
Your Name 2021-08-16 18:24:33 -04:00
parent 23e8eecee7
commit d9c4801be5
1 changed files with 3 additions and 1 deletions

View File

@ -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