diff options
| author | Nikolaus Gotsche <n@softwarefools.com> | 2018-10-04 01:00:25 +0200 |
|---|---|---|
| committer | Nikolaus Gotsche <n@softwarefools.com> | 2018-10-04 01:00:25 +0200 |
| commit | e9bad489128dd526b44b08cc3bed6cce1cb731da (patch) | |
| tree | 85eda351ea985e240cedf831c1c86111fc4a6c5e /sqlite.go | |
| parent | a4a53949409944ae1745a8ab16901fb9a21ac7c4 (diff) | |
new getNewInput
Diffstat (limited to 'sqlite.go')
| -rw-r--r-- | sqlite.go | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -879,6 +879,22 @@ func setProject (nid int) { } } +func getCustomerList() (outint []int, outstr []string) { + rows,err := db.Query("SELECT id, company, name FROM customers") + checkErr(err) + var id int + var comp string + var name string + for rows.Next() { + err = rows.Scan(&id, &comp, &name) + checkErr(err) + st := fmt.Sprintf("%s: %s",comp,name) + outint = append(outint,id) + outstr = append(outstr, st) + } + return +} + func allCustomers() { rows,err := db.Query("SELECT * FROM customers") //rows,err := db.Query("SELECT (id, company, name, address, satz, lastbill) FROM customers") |
