Documentation TYPO3 par Ameos

testpaging.php

00001 <?php
00002 /* 
00003 V4.80 8 Mar 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
00004   Released under both BSD license and Lesser GPL library license. 
00005   Whenever there is any discrepancy between the two licenses, 
00006   the BSD license will take precedence. 
00007   Set tabs to 4 for best viewing.
00008         
00009   Latest version is available at http://adodb.sourceforge.net
00010 */
00011 
00012 error_reporting(E_ALL);
00013 
00014 
00015 include_once('../adodb.inc.php');
00016 include_once('../adodb-pager.inc.php');
00017 
00018 $driver = 'oci8';
00019 $sql = 'select  ID, firstname as "First Name", lastname as "Last Name" from adoxyz  order  by  id';
00020 //$sql = 'select count(*),firstname from adoxyz group by firstname order by 2 ';
00021 //$sql = 'select distinct firstname, lastname from adoxyz  order  by  firstname';
00022 
00023 if ($driver == 'postgres') {
00024         $db = NewADOConnection('postgres');
00025         $db->PConnect('localhost','tester','test','test');
00026 }
00027 
00028 if ($driver == 'access') {
00029         $db = NewADOConnection('access');
00030         $db->PConnect("nwind", "", "", "");
00031 }
00032 
00033 if ($driver == 'ibase') {
00034         $db = NewADOConnection('ibase');
00035         $db->PConnect("localhost:e:\\firebird\\examples\\employee.gdb", "sysdba", "masterkey", "");
00036         $sql = 'select distinct firstname, lastname  from adoxyz  order  by  firstname';
00037 
00038 }
00039 if ($driver == 'mssql') {
00040         $db = NewADOConnection('mssql');
00041         $db->Connect('JAGUAR\vsdotnet','adodb','natsoft','northwind');
00042 }
00043 if ($driver == 'oci8') {
00044         $db = NewADOConnection('oci8');
00045         $db->Connect('','scott','natsoft');
00046         
00047 $sql = "select * from (select  ID, firstname as \"First Name\", lastname as \"Last Name\" from adoxyz 
00048          order  by  1)";
00049 }
00050 
00051 if ($driver == 'access') {
00052         $db = NewADOConnection('access');
00053         $db->Connect('nwind');
00054 }
00055 
00056 if (empty($driver) or $driver == 'mysql') {
00057         $db = NewADOConnection('mysql');
00058         $db->Connect('localhost','root','','test');
00059 }
00060 
00061 //$db->pageExecuteCountRows = false;
00062 
00063 $db->debug = true;
00064 
00065 if (0) {
00066 $rs = &$db->Execute($sql);
00067 include_once('../toexport.inc.php');
00068 print "<pre>";
00069 print rs2csv($rs); # return a string
00070 
00071 print '<hr />';
00072 $rs->MoveFirst(); # note, some databases do not support MoveFirst
00073 print rs2tab($rs); # return a string
00074 
00075 print '<hr />';
00076 $rs->MoveFirst();
00077 rs2tabout($rs); # send to stdout directly
00078 print "</pre>";
00079 }
00080 
00081 $pager = new ADODB_Pager($db,$sql);
00082 $pager->showPageLinks = true;
00083 $pager->linksPerPage = 10;
00084 $pager->cache = 60;
00085 $pager->Render($rows=7);
00086 ?>


Généré par Le spécialiste TYPO3 avec  doxygen 1.4.6