Reputation: 33747
I'm new to Go and I'm trying to query a mysql database. I tried the following code:
rows, err := db.QueryRow("SELECT * FROM t_users")
But running the go run main.go
gives this error:
cannot assign 1 values to 2 variables
But I don't get any errors for this:
rows, err := db.Query("DESCRIBE t_user")
How come my select statement is giving an error?
Upvotes: 0
Views: 438
Reputation: 33747
mkopriva's response
QueryRow returns one value, Query returns two
Upvotes: 2