X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.192]) by svr1.postgresql.org (Postfix) with ESMTP id 29221CCD23 for ; Fri, 18 Jul 2003 14:33:36 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr4.postgresql.org [64.117.224.192]) (amavisd-new, port 10024) with ESMTP id 08072-08 for ; Fri, 18 Jul 2003 14:34:02 +0000 (GMT) Received: from web14802.mail.yahoo.com (web14802.mail.yahoo.com [216.136.224.218]) by svr1.postgresql.org (Postfix) with SMTP id 1F9F1CCD4D for ; Fri, 18 Jul 2003 11:33:33 -0300 (ADT) Message-ID: <20030718143405.32341.qmail@web14802.mail.yahoo.com> Received: from [200.219.69.252] by web14802.mail.yahoo.com via HTTP; Fri, 18 Jul 2003 11:34:05 ART Date: Fri, 18 Jul 2003 11:34:05 -0300 (ART) From: =?iso-8859-1?q?=C2ngelo=20Marcos=20Rigo?= Subject: Paginating results To: pgsql-php@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/34 X-Sequence-Number: 2146 Hi I am trying to write a script to paginate results the problem is that this script just return something after the second page the first do not return nothing. The other problem is that the script just add the next set of results at the end of the old set of results, instead of paginate to them. "; } // Figure out the total number of results in DB: $total_results = pg_result(pg_query("SELECT COUNT(*) as Num FROM paginar"),0); // Figure out the total number of pages. Always round up using ceil() $total_pages = ceil($total_results / $max_results); // Build Page Number Hyperlinks echo "
Selecione uma página
"; // Build Previous Link if($page > 1){ $prev = ($page - 1); echo "< "; } for($i = 1; $i <= $total_pages; $i++){ if(($page) == $i){ echo "$i "; } else { echo "$i "; } } // Build Next Link if($page < $total_pages){ $next = ($page + 1); echo "Next>>"; } echo "
"; ?> ===== Ângelo Marcos Rigo AMR Informática (51) 3348 0870 Rua Pe. Alois Kades 400/210 Porto Alegre /RS/Brasil http://amr.freezope.org angelo_rigo@yahoo.com.br _______________________________________________________________________ Yahoo! Mail Mais espaço, mais segurança e gratuito: caixa postal de 6MB, antivírus, proteção contra spam. http://br.mail.yahoo.com/