fixes #24

Mysql LIMIT must be the last option in a SQL statement