<? if($acao == ''){ if(!isset($pag)){ $pg = 0; $inicial = $pag * 3; //3 é o num de resultados por tela $sql = "SELECT * FROM noticias ORDER BY id DESC LIMIT $inicial, 5"; $result = $conn->Execute($sql); $totalReg = $result->NumRows(); //total de registros $pages = intval($totalReg/3); //total de paginas while($txt = $result->FetchRow()){?> <div class="dvalbum2"> <img src="<?=$txt['miniatura']?>"/> <h5><?=$txt['titulo']?></h5> </div> <? } //fecha while }?> <br style="clear:both;" /> <div id="paginacao"> <? if ($pg <> 0) { $url = $pg - 1; echo "<a id=mulink href='?pagina=noticias&pg=$url'>5 anteriores</a> "; }else{ echo " "; } for ($i = 0; $i<($pages + 1); $i++) { if ($i == $pg) { echo "<font face=Arial size=2 color=ff0000><b> $i </b></font>"; } else { echo "<a id=mulink href='?pagina=noticias&pg=$i'> $i </a>"; } } ?> </div> <? } ?>
michelmfreitas's Content
There have been 26 items by michelmfreitas (Search limited from 30/03/2023)