PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Peter Pivarc  >  Oracle database  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example of usage
Class: Oracle database
Execute Oracle database queries
Author: By
Last change: added comment
Date: 8 years ago
Size: 792 bytes


Class file image Download
//include source of oracle-db class
//don't forget to create folder "log" in current directory, where class creates error log file if you pass invalid sql

//define connection parameters:
//login to database (scheme name)
//password to database
//database name - like in tnsnames.ora
$dbs['TESTDB'] = array("login", "password", "test_db");

//create instance of testdb database
$db = new database($dbs['TESTDB']);

//define sql script
$sql = "select test_a, test_b from xyz";

//select data by sql script ad store results in associative array $ret
$ret = $db->_select($sql);

//print results

//array will look like
// "test_a"=>array("a1","a2", "a3"),
// "test_b"=>array("b1", "b2", "b3")