include "db/db.php"; $SQL=new Conexao(); $numreg = 20; // Quantos registros por página vai ser mostrado if (!isset($_GET['pg'])){ $pg = 0; }else $pg=$_GET['pg']; $inicial = $pg * $numreg; //######### FIM dados Paginação // Faz o Select pegando o registro inicial até a quantidade de registros para página //$sql = mysql_query("SELECT * FROM tabela LIMIT $inicial, $numreg"); $res=$SQL->executa("SELECT *,DATE_FORMAT(dataCadastro,'%d/%m') as data FROM arquivo a ORDER BY a.dataCadastro DESC LIMIT $inicial, $numreg"); // Serve para contar quantos registros vc tem na seua tabela para fazer a paginação $sql_conta = $SQL->executa("SELECT * FROM arquivo ORDER BY dataCadastro DESC"); $quantreg = $sql_conta->num_rows; // Quantidade de registros pra paginação ?>
![]() |
|||||||
![]() |
|
||||||
![]() |