sql
This commit is contained in:
parent
23e8eecee7
commit
d9c4801be5
4
main.go
4
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
|
||||
|
|
Loading…
Reference in New Issue