PHP Classes

File: examples/example.php

Recommend this page to a friend!
  Classes of Unay Santisteban   Database PDO Abstract Layer   examples/example.php   Download  
File: examples/example.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Database PDO Abstract Layer
Run queries with PDO and get results in XML, JSON
Author: By
Last change: Update of examples/example.php
Date: 1 month ago
Size: 592 bytes


Class file image Download

require_once "../autoload.php";

$db = new OtherCode\Database\Database();

try {

'driver' => 'mysql',
'host' => 'localhost',
'dbname' => 'test',
'username' => 'root',
'password' => 'root'

$query = $db->getQuery();
$query->where('name', '=', ':name');

$db->execute(array(':name' => 'Walter'));

$result = $db->loadObject();


} catch (\
Exception $e) {