fix limit in query

This commit is contained in:
stremovsky
2019-12-12 19:37:56 +02:00
parent d2fe51a6da
commit 986c22eab1

View File

@@ -515,7 +515,10 @@ func (dbobj dbcon) getList(t Tbl, keyName string, keyValue string, start int32,
}
q := "select * from " + table + " WHERE " + keyName + "=\"" + keyValue + "\""
if limit > 0 {
if start > 0 {
q = q + " LIMIT " + strconv.FormatInt(int64(start), 10) + "," +
strconv.FormatInt(int64(limit), 10)
} else if limit > 0 {
q = q + " LIMIT " + strconv.FormatInt(int64(limit), 10)
}
fmt.Printf("q: %s\n", q)