PHP Classes

File: managerExample.php

Recommend this page to a friend!
  Classes of DZEUKOU YVES   Query in any table   managerExample.php   Download  
File: managerExample.php
Role: Example script
Content type: text/plain
Description: manager example
Class: Query in any table
Compose and execute SQL SELECT queries
Author: By
Last change:
Date: 6 years ago
Size: 861 bytes
 

Contents

Class file image Download
<?php
   
/* ydzeukou@gmail.com */

    /*This is just an example of the usage
    not really a working application
   
    EXAMPLE TABLE
    -------------
    CREATE TABLE IF NOT EXISTS `myTable` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `firstName` varchar(255) NOT NULL,
      `lastName` varchar(255) NOT NULL,
      `town` varchar(255) NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;

    */

   
$data = "myData";
   
$login = "root";
   
$pwd = "";

    try{
       
$db = new PDO("mysql:host=localhost;dbname=$data","$login","$pwd");
    catch(
Exception $e)
    {
        die(
'Error...');
    }
    require
'managerClass.php';

   
$manager = new RenderModel($db);

   
$myTable = $manager->fetchs("myTable",array('*'),array('town ='=>"libreville"));
   
//$myTable = $manager->fetchs("myTable",array('*'),array('town ='=>"libreville"),10);

   
printr_($myTable);
?>