Not sure if this will work, I don't have my IDE with me.
$numPerPage = 15;
//We'll pass the page through our query string. So check it,
//and assign it to a var.
$page = (!empty($_GET['pg'])&&eregi("^[0-9]{1,9}$", $_GET['pg'])) ? $_GET['pg'] : 0;
$start = $page * $numPerPage;
$end = $start +...