maxvalue, err := db.Exec("SELECT MAX(points) FROM items")
cannot use maxvalue (type sql.Result) as type string in assignment
t.ExecuteTemplate(w, "single", Data)
func GetMaxPoints(db *sql.DB) (int64, error) {
rows, err := db.Query(`SELECT MAX(points) FROM items`)
if err != nil {
return 0, err
}
defer rows.Close()
rows.Next()
var maxPoints int64
err = rows.Scan(&maxPoints)
return maxPoints, err
}