Login   Register  
PHP Classes
elePHPant
Icontem

File: demos/demo3.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Giovanni Ramos  >  PDO4You  >  demos/demo3.php  >  Download  
File: demos/demo3.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PDO4You
Access SQL databases using the PDO extension
Author: By
Last change: Refactory full
Date: 1 year ago
Size: 794 bytes
 

Contents

Class file image Download
<?php
// Loading demo class
require 'DemoCRUD.php';

// Example with Multiple Instances
echo '<h2><a href=".">DEMOS</a> &rsaquo; MULTIPLE INSTANCES</h2>';

// Importing classes
use PDO4You\PDO4You;

// Creating an instance
$demo = new DemoCRUD;

// Displaying records of the default instance "standard"
$demo->select();

PDO4You::getInstance('bookstore''sqlite:data/database_bookstore.db');
PDO4You::getInstance('pdo4you''sqlite:data/database_pdo4you.db');

// Displaying records from the data instance: bookstore
$demo->select('bookstore');

// Displaying records from the data instance: pdo4you
$demo->select('pdo4you');

// Sets another instance
PDO4You::setInstance('standard');
#PDO4You::setInstance('bookstore');

// Displaying records from the last data instance set
$demo->select();