PHP Classes

Query in any table: Compose and execute SQL SELECT queries

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 188 All time: 8,617 This week: 455Up
Version License PHP version Categories
managerexample 1.0.0Freely Distributable5PHP 5, Databases
Description 

Author

This class can compose and execute SQL SELECT queries.

It as parameters a table name, list of fields, a condition clause and an optional limit number of rows to retrieve.

The class executes a SQL SELECT query and returns the results in an array.

Picture of DZEUKOU YVES
Name: DZEUKOU YVES <contact>
Classes: 1 package by
Country: Gabon Gabon

Example

<?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);
?>


  Files folder image Files (2)  
File Role Description
Plain text file managerClass.php Class table manager
Accessible without login Plain text file managerExample.php Example manager example

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:188
This week:0
All time:8,617
This week:455Up