PHP Classes

File: fwphp/glomodul/blog_akram/Include/DB_oracle.php

Recommend this page to a friend!
  Classes of Slavko Srakocic   B12 PHP FW   fwphp/glomodul/blog_akram/Include/DB_oracle.php   Download  
File: fwphp/glomodul/blog_akram/Include/DB_oracle.php
Role: Example script
Content type: text/plain
Description: Example script
Class: B12 PHP FW
Manage database records with a PDO CRUD interface
Author: By
Last change:
Date: 1 year ago
Size: 944 bytes
 

Contents

Class file image Download
<?php

    $do_pgntion
= null ;
   
$db_i = 'oci' ;
   
$db_hostname = 'dev1:1521/XE:pooled;charset=UTF8' ;
   
$db_name = 'hr' ;
   
$db_username = 'hr' ;
   
$db_userpwd = 'hr' ;
   
   
$dsn = $db_i.':dbname='.$db_hostname ;


    try
    {
     
//if( !isset( $instance ) || !($instance instanceof PDO) )
      //{
        // FETCH_ASSOC
       
$options = [
          
PDO::ATTR_PERSISTENT => true
         
,PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
         
,PDO::ATTR_ORACLE_NULLS => PDO::NULL_TO_STRING
         
//,PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ
          //,PDO::ATTR_EMULATE_PREPARES => false
       
];
       
$conn = new PDO($dsn,$db_username,$db_userpwd,$options);
                     
//echo 'connected, $db_i='.$db_i .', DBI='. DBI ;
      //}

      //return $conn; //instance

   
}
    catch(
PDOException $e )
    {
      die(
'Database Error: ' . $e->getMessage() );
    }
   
# Method End