Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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: 2009-12-05 10:04
Size: 792 bytes
 

Contents

Class file image Download
<?php
//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
require_once('db.class.php');

//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 
print_r($ret);

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