Update database.php

-Added "1 = 1 AND " after WHERE in select and pager queries. Now, if you have to add something like "order by" and don't have a where condition, there's no error for having "WHERE ORDER BY".