Update main.go

This commit is contained in:
s441433 2018-12-29 02:31:03 +01:00
parent 9ace20ce5d
commit d3cbeac65a

15
main.go
View File

@ -31,19 +31,20 @@ func panel(w http.ResponseWriter, r *http.Request) {
rows, err := db.Query("SELECT * FROM users") rows, err := db.Query("SELECT * FROM users")
checkErr(err) checkErr(err)
var IDusers int var IDusers int
var Username string var User string
var Password string var Password string
var PIN int var PIN int
var RFID int var RFID int
for rows.Next() { for rows.Next() {
err = rows.Scan(&IDusers, &Username, &Password, &PIN, &RFID) err = rows.Scan(&IDusers, &User, &Password, &PIN, &RFID)
checkErr(err) checkErr(err)
fmt.Printf("%d, %s, %s, %d, %d \n", IDusers, Username, Password, PIN, RFID) fmt.Printf("%d. %s, %s, %d, %d \n", IDusers, User, Password, PIN, RFID)
fmt.Fprintln(w, IDusers) fmt.Fprint(w, IDusers)
fmt.Fprintln(w, ". ") fmt.Fprint(w, ". ")
fmt.Fprintln(w, Username) fmt.Fprint(w, User)
fmt.Fprintln(w, "\n") fmt.Fprint(w, " \n")
} }
rows.Close() rows.Close()
db.Close() db.Close()