gf/.example/database/gdb/mysql/gdb_config.go

17 lines
249 B
Go

package main
import (
"fmt"
"github.com/gogf/gf/frame/g"
)
func main() {
if r, err := g.DB().Table("user").Where("uid=?", 1).One(); err == nil {
fmt.Println(r["uid"].Int())
fmt.Println(r["name"].String())
} else {
fmt.Println(err)
}
}