PHP Classes

File: demos/demo6.php

Recommend this page to a friend!
  Classes of Giovanni Ramos  >  PDO4You  >  demos/demo6.php  >  Download  
File: demos/demo6.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PDO4You
Access SQL databases using the PDO extension
Author: By
Last change: Updated Pagination class
Date: 2 years ago
Size: 1,146 bytes


Class file image Download
// Loading demo class
require 'DemoRegister.php';

// Example with Pagination
echo '<h2><a href=".">DEMOS</a> &rsaquo; READING WITH PAGING</h2>';

// Importing classes
use PDO4You\Pagination as pager;

// Enable pagination: If the passed value is TRUE enables paging for friendly URLs

// Sets the number of records per page

// Sets the page navigation

// Creating an instance
$demo = new DemoRegister;

<div class="pdo4you">
    <form method="post">
        <h3><?php echo $demo::ADD_NEW_USER; ?></h3>

        <div><?php echo $demo::FIRST_NAME; ?>: <input type="text" name="firstname" /></div>
        <div><?php echo $demo::LAST_NAME; ?>: <input type="text" name="lastname" /></div>
        <div><?php echo $demo::MAIL; ?>: <input type="text" name="mail" /></div>
        <div><input type="submit" value="Register" /></div>

    <?php echo $demo->getMessage(); ?>

    <?php echo $demo::TOTAL_USERS; ?>: <?php echo $demo->getTotalOfRecords(); ?>

    <?php echo $demo->showRecords(); ?>

    <?php echo pager::getPagination(); ?>