PHP Classes

File: Example.php

Recommend this page to a friend!
  Classes of Sam Stevens  >  MySQL Abstractor  >  Example.php  >  Download  
File: Example.php
Role: Example script
Content type: text/plain
Description: Example Use
Class: MySQL Abstractor
MySQL database abstraction layer
Author: By
Last change:
Date: 15 years ago
Size: 1,336 bytes


Class file image Download
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>DBAL Example</title>

<h1>DBAL Example</h1>
See the <a href="manual.html">manual</a> for more info.

$db = null;
// Create dbal class
    // host user password database debug mode debug level
$db = new DBALayer("localhost","SQLUser","SQLPass","SQLDataBase", true , 1 );
catch (
Exception $e)
//Catch exceptions (cannot connect to db etc..)
die ($e->GetMessage());
//method 1
echo "Method 1";
$DBTAL = $db->GetDBTAL("Test_Table"); //get dbal table object
$DBTAL->SetDefaultLimit("1"); //Limit the amount of queries returned (optional)

$result = $DBTAL->Select("","col1, col2","col1 DESC");
while (
$record = mysql_fetch_array($result))

//method 2
echo "Method 2";
$result = $db->Select("","col1, col2","col1 DESC");
while (
$record = mysql_fetch_array($result))


For more information send a message to info at phpclasses dot org.