<?php require('mysqlPaging.class.inc'); $pagging = new mysqlPaging("SELECT * FROM table WHERE status = '2' ORDER BY id DESC", 20, $dbLink); $pagging->printPagesNums(); print $pagging->returnQuery(); ?>