We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
var v = &struct { EmpNo int `gorm:"emp_no"` BirthDate time.Time `gorm:"birth_date"` FirstName string `gorm:"first_name"` LastName string `gorm:"last_name"` Gender string `gorm:"gender"` HireDate time.Time `gorm:"hire_date"` }{} db, _ := sql.Open("mysql", "dksl:123456@tcp(127.0.0.1:13306)/employees?timeout=1s&readTimeout=1s&writeTimeout=1s&parseTime=true&loc=Local&charset=utf8mb4,utf8") //连接数据库 defer db.Close() row := db.QueryRow(`SELECT emp_no FROM employees`) if err := row.Scan(&v.EmpNo); err != nil { panic(err) } fmt.Println(v.EmpNo)
运行结果: panic: sql: no rows in result set
What happened: 表中有值,也给客户端返回结果了,但是客户端没解析出来
What you expected to happen:
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
The text was updated successfully, but these errors were encountered:
db 啥版本啊
Sorry, something went wrong.
5.7.34
Successfully merging a pull request may close this issue.
运行结果:
panic: sql: no rows in result set
What happened:
表中有值,也给客户端返回结果了,但是客户端没解析出来
What you expected to happen:
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
The text was updated successfully, but these errors were encountered: