PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Anderson A. Meggiolaro   Paginator Iterator   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example 1
Class: Paginator Iterator
Iterate over listings split in page using Smarty
Author: By
Last change:
Date: 15 years ago
Size: 649 bytes
 

Contents

Class file image Download
<?php

   
include('pi_lib/PaginatorIterator.php');

   
$mysql=@mysql_connect('localhost', 'root', '123456', 'j15') or die('Cant connect');
   
mysql_select_db('j15', $mysql);
   
#$db=new PDO('mysql:dbname=j15;host=127.0.0.1', 'root', '123456');

   
PaginatorIterator::setHandlerFunc('mysql'); # defaults to pdo
   
PaginatorIterator::setConnection($mysql);

    include(
'Smarty-2.6.19/Smarty.class.php');
   
$smarty=new Smarty;
   
$smarty->plugins_dir[]="./plugins";

   
$smarty->assign('ds', "select * from jos_menu limit :LIMIT offset :OFFSET");
   
$smarty->assign('numrows', "select count(*) from jos_menu");
   
   
$smarty->display("example.tpl");


?>