note 38014 deleted from function.mssql-data-seek by vincent

From: Date: Thu, 04 Dec 2003 16:39:39 +0000
Subject: note 38014 deleted from function.mssql-data-seek by vincent
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-61413@lists.php.net to get a copy of this message
Note Submitter: andre.listas@infolink.com.br ---- Estou postando a nível de manter uma cópia on-line o script php de paginação de resultados utilizando a função mssql_data_seek em substituição do limit que temos no mysql. Também conto com a colaboração de todos para updates e melhorias deste script. I am posting the level to keep a copy on-line script php of paging of results using the function mssql_data_seek in substitution of limit that we have in mysql. Also story with the contribution of all for updates and improvements of this script. <!-- //Query e tratamento --> <? if(empty($_GET['p'])){$Pagina = "1";}else{$Pagina = $_GET['p'];} $SQL=""; $ConsultaSQL = mssql_query($SQL); $RegPP = 10; $ContaReg = mssql_num_rows($ConsultaSQL); $Total = ceil($ContaReg / $RegPP); if( empty($Pagina) ) { $inicio = 0; } else { $inicio = (($Pagina -1) * $RegPP); } if ($ContaReg <> 0) { $RegIni = mssql_data_seek($ConsultaSQL, $inicio); } ?> <!-- // Controle de links para navagação entre as páginas --> <? if($Pagina > 1) { $menos = $Pagina - 1; $url = $_SERVER['PHP_SELF']."?p=".$menos; echo "<a href=".$url." class='TextoAvisos'>&laquo;</a>"; } ?> <span class="TextoDados"><? echo $Pagina; ?></span> de <span class="TextoDados"><? echo $Total; ?></span> <? if($Pagina < $Total) { $mais = $Pagina + 1; $url = $_SERVER['PHP_SELF']."?p=".$mais; echo "<a href=".$url." class='TextoAvisos'>&raquo;</a>"; } ?> <!-- //Mostrando os dados dentro do while --> <? $MaxExibe = ($RegPP + 1); $Ocorrencia = 0; while ( $registro = mssql_fetch_array($ConsultaSQL)){ $Ocorrencia++; if ($Ocorrencia < $MaxExibe) { ?> <table .... blabla ...resulbusca.... .../table> <? }//Fecha if ($Ocorrencia < $MaxExibe) }//Fecha while ?> <!-- // Controle de links para navagação entre as páginas --> <? if($Pagina > 1) { $menos = $Pagina - 1; $url = $_SERVER['PHP_SELF']."?result=3&p=".$menos; echo "<a href=".$url." class='TextoAvisos'>&laquo;</a>"; } ?> <span class="TextoDados"><? echo $Pagina; ?></span> de <span class="TextoDados"><? echo $Total; ?></span> <? if($Pagina < $Total) { $mais = $Pagina + 1; $url = $_SERVER['PHP_SELF']."?result=3&p=".$mais; echo "<a href=".$url." class='TextoAvisos'>&raquo;</a>"; } ?> André de Abreu - Rio de Janeiro - Brasil 04/12/2003 - ICQ#85785655

« previous php.notes (#61413) next »