PHP code example of jpina / oci8

1. Go to this page and download the library: Download jpina/oci8 library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jpina / oci8 example snippets


try {
    $db = new Jpina\Oci8Connection('username', 'password', '//localhost:1521/XE');
    // Closing database to force an error on next statement
    $db->close();
    // This statement will throw an Oci8Exception since there is no active connection
    $statement = $db->parse('SELECT * FROM dual');
} catch (Jpina\Oci8Exception $ex) {
    // Handle the Exception
}
 php
$db = new Jpina\Oci8Connection('username', 'password', '//localhost:1521/XE');
$statement = $db->parse('SELECT * FROM dual');
$statement->execute();
$row = $statement->fetchAssoc();