PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Aderbal Nunes   PDO Connection Factory   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: User example
Class: PDO Connection Factory
Manage database connections using PDO extension
Author: By
Last change:
Date: 16 years ago
Size: 470 bytes


Class file image Download

$db = new PDOConnectionFactory();
$pdo = $db->getConnection();

 * example of list for names of table 'agenda'
$stmt = $pdo->prepare("SELECT * FROM agenda");
    while (
$rs = $stmt->fetch(PDO::FETCH_OBJ)) {
// 'name' is real name of field
echo "output: ".$rs->name."<br />";
$pdo = null;
PDOException $e){ echo $e->getMessage(); }