sql
This commit is contained in:
4
main.go
4
main.go
@@ -6,6 +6,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"flag"
|
"flag"
|
||||||
|
"fmt"
|
||||||
"github.com/elliotchance/phpserialize"
|
"github.com/elliotchance/phpserialize"
|
||||||
_ "github.com/go-sql-driver/mysql"
|
_ "github.com/go-sql-driver/mysql"
|
||||||
"log"
|
"log"
|
||||||
@@ -124,7 +125,8 @@ func loadDbEntries(ot string, id int64) map[string]metadataValues {
|
|||||||
log.Printf("Invalid object type: %s", ot)
|
log.Printf("Invalid object type: %s", ot)
|
||||||
return entries
|
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 {
|
if err != nil {
|
||||||
log.Printf("db.Query: %s\n", err.Error())
|
log.Printf("db.Query: %s\n", err.Error())
|
||||||
return entries
|
return entries
|
||||||
|
Reference in New Issue
Block a user