1
0
mirror of https://github.com/gogf/gf.git synced 2025-04-05 11:18:50 +08:00
gf/.example/database/gdb/mysql/gdb_config.go
2021-10-11 21:41:56 +08:00

17 lines
252 B
Go

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