Fix paginate spawning mysql errors

This commit is contained in:
Howl 2016-04-07 12:08:44 +02:00
parent cf3b30d851
commit 34593ef428

View File

@ -28,6 +28,12 @@ func Paginate(page, limit string) string {
lInt = 50 lInt = 50
} }
} }
if pInt < 1 {
pInt = 1
}
if lInt < 1 {
lInt = 50
}
start := (pInt - 1) * lInt start := (pInt - 1) * lInt
return fmt.Sprintf(" LIMIT %d,%d ", start, lInt) return fmt.Sprintf(" LIMIT %d,%d ", start, lInt)
} }