1. Go to this page and download the library: Download elie29/oci-driver 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/ */
elie29 / oci-driver example snippets
// SELECT * FROM params ORDER BY name ASC
$sql = Select::start() // aka (new Select)
->column('*')
->from('params')
->orderBy('name')
->build();
// SELECT p.id FROM params p UNION SELECT p.id FROM params_his p ORDER BY id ASC
$sql = Select::start() // aka (new Select)
->column('p.id')
->from('params', 'p')
->union()
->column('p.id')
->from('params_his', 'p')
->orderBy('id')
->build();
// DELETE FROM params WHERE id = 2
$sql = Delete::start() // aka (new Delete)
->from('params')
->where('id = 2')
->build();
// UPDATE users u SET u.name = 'O''neil' WHERE u.user_id = 1
$sql = Update::start() // aka (new Update)
->table('users', 'u')
->set('u.name', Update::quote("O'neil"))
->where('u.user_id = 1')
->build();
$driver = Factory::create(Provider::getConnection(), 'test');
$sql = 'SELECT * FROM A1 WHERE N_DATE BETWEEN :YESTERDAY AND :TOMORROW';
$bind = (new Parameter())
->add(':YESTERDAY', date(Format::PHP_DATE, time() - 86400)) // N_DATE type is DATE
->add(':TOMORROW', date(Format::PHP_DATE, time() + 86400));
$rows = $driver->fetchAllAssoc($sql, $bind);