Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php for( $i = 0; $i < count( $results-
- >data ); $i++ ) : ?>
- <tr>
- <td><?php echo $results-
- >data[$i]['Name']; ?></td>
- <td><?php echo $results-
- >data[$i]['Country']; ?></td>
- <td><?php echo $results-
- >data[$i]['Continent']; ?></td>
- <td><?php echo $results-
- >data[$i]['Region']; ?></td>
- </tr>
- <?php endfor; ?>
- Now for make use of our Paginator
- class add the following php code at the
- top of the document.
- <?php
- require_once 'Paginator.class.php';
- $conn = new mysqli( '127.0.0.1',
- 'root', 'root', 'world' );
- $limit = ( isset( $_GET['limit'] ) ) ?
- $_GET['limit'] : 25;
- $page = ( isset( $_GET['page'] ) )
- ? $_GET['page'] : 1;
- $links = ( isset( $_GET['links'] ) ) ?
- $_GET['links'] : 7;
- $query = "SELECT City.Name,
- City.CountryCode, Country.Code,
- Country.Name AS Country,
- Country.Continent, Country.Region
- FROM City, Country WHERE
- City.CountryCode = Country.Code";
- $Paginator = new Paginator( $conn,
- $query );
- $results = $Paginator->getData( $
- page, $limit );
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement