Hello, follow these steps below to create your own plugin:
- Create a file called 'you_plugin_name.php', inside the plugin's folder; (example 'pgsql.php')
- We need to create 2 function inside the file : pi_pgsql_ds(&$db, $sql, &$pi) and pi_pgsql_numrows(&$db, $sql, &$pi)
- The first one function must to return an array (the result set)
- The second function must to return the number of TOTAL rows of the pagination,
not only the rows of the result set paginated, but the entire rows of the pagination.
THE PARAMETERS:
- &$db :
The database connection, can be whatever you want, 'object' or 'resource'
- $sql :
The SQL statement to be executed
- &$pi :
The PaginatorIterator current instance. Maybe usefull.
HOW TO USE THAT:
$conn=pg_connect("dbname=j15");
include('PaginatorIterator.php');
PaginatorIterator::setConnection($conn);
PaginatorIterator::setHandlerFunc('pgsql');
that's it. |