Update database.php

-Fixed a bug in the button

I also forgot to mention in the last change log, I've added buttons and a buttonset for paging buttons based on rewritten URLs. The regular buttons only worked on url strings "?page=X". The rewritten ones work on "/page/X/".