aboutsummaryrefslogtreecommitdiff
path: root/server/database
diff options
context:
space:
mode:
authorMikunoNaka <bokuwakanojogahoshii@yahoo.com>2021-06-15 12:25:46 +0530
committerMikunoNaka <bokuwakanojogahoshii@yahoo.com>2021-06-15 12:25:46 +0530
commitea88466fda6c719caa9daae5ea4698565fa84426 (patch)
treecf643b82c43a1724aaa3676fcd7f19e386b9435c /server/database
parent37ead7ea9ca1e0c435c57866c289917e0f488459 (diff)
fixed some errors in SelectClientForm
Diffstat (limited to 'server/database')
-rw-r--r--server/database/people.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/server/database/people.go b/server/database/people.go
index ac2affa..5fc3bf5 100644
--- a/server/database/people.go
+++ b/server/database/people.go
@@ -14,6 +14,7 @@ import (
_ "github.com/mattn/go-sqlite3"
)
type Person struct {
+ ID string
Name string
Address string
Phone string
@@ -23,16 +24,16 @@ type Person struct {
func GetAllPeople() []Person {
var allPeople []Person
rows, _ := myDatabase.Query(
- `SELECT Name, Address, Phone, Email FROM People`,
+ `SELECT ID, Name, Address, Phone, Email FROM People`,
)
var (
- name, address, phone, email string
+ id, name, address, phone, email string
)
for rows.Next() {
- rows.Scan(&name, &address, &phone, &email)
- allPeople = append(allPeople, Person{name, address, phone, email})
+ rows.Scan(&id, &name, &address, &phone, &email)
+ allPeople = append(allPeople, Person{id, name, address, phone, email})
}
return allPeople