mirror of
https://github.com/dg/dibi.git
synced 2025-08-10 16:14:57 +02:00
* renamed some files libs
* added doc comments to drivers * DibiDriver::prepare() renamed to config() * fixed connection error handling in Postgre driver
This commit is contained in:
@@ -60,12 +60,8 @@ class MyDateTime implements DibiVariableInterface
|
||||
|
||||
// CHANGE TO REAL PARAMETERS!
|
||||
dibi::connect(array(
|
||||
'driver' => 'mysql',
|
||||
'host' => 'localhost',
|
||||
'username' => 'root',
|
||||
'password' => 'xxx',
|
||||
'database' => 'dibi',
|
||||
'charset' => 'utf8',
|
||||
'driver' => 'sqlite',
|
||||
'database' => 'sample.sdb',
|
||||
));
|
||||
|
||||
|
||||
|
@@ -58,6 +58,11 @@ foreach ($res as $row => $fields) {
|
||||
echo '<hr>';
|
||||
|
||||
|
||||
// fetch row by row with defined offset
|
||||
foreach ($res->getIterator(2) as $row => $fields) {
|
||||
print_r($fields);
|
||||
}
|
||||
|
||||
// fetch row by row with defined offset and limit
|
||||
foreach ($res->getIterator(2, 1) as $row => $fields) {
|
||||
print_r($fields);
|
||||
@@ -74,3 +79,11 @@ INNER JOIN [customers] USING ([customer_id])
|
||||
$assoc = $res->fetchAssoc('customers.name,products.title'); // key
|
||||
print_r($assoc);
|
||||
echo '<hr>';
|
||||
|
||||
$assoc = $res->fetchAssoc('customers.name,*,products.title'); // key
|
||||
print_r($assoc);
|
||||
echo '<hr>';
|
||||
|
||||
$assoc = $res->fetchAssoc('customers.name,#,products.title'); // key
|
||||
print_r($assoc);
|
||||
echo '<hr>';
|
||||
|
Reference in New Issue
Block a user