1. Go to this page and download the library: Download pontikis/dacapo 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/ */
pontikis / dacapo example snippets
$sql = 'SELECT procuct_name FROM products WHERE manufacturer = ? and type IN (?,?,?)';
use Pontikis\Database\Dacapo;
use Pontikis\Database\DacapoErrorException;
$db_settings = [
'rdbms' => Dacapo::RDBMS_POSTGRES, // or Dacapo::RDBMS_MYSQLI for MySQL/MariaDB
'db_server' => 'localhost',
'db_user' => 'foo',
'db_passwd' => 'bar',
'db_name' => 'baz',
];
try {
$ds = new Dacapo($db_settings);
} catch (Exception $e) {
// your code here
}
$sql = 'SELECT id, firstname, lastname FROM customers WHERE lastname LIKE ?';
$bind_params = ['%' . $str . '%'];
try {
$ds->select($sql, $bind_params);
$customers = $ds->getData();
} catch (DacapoErrorException $e) {
// your code here
}