1
0
mirror of https://github.com/dg/dibi.git synced 2025-07-31 03:10:14 +02:00

update to 0.5alpha

This commit is contained in:
David Grudl
2006-06-04 23:06:33 +00:00
commit 0d18c4c366
21 changed files with 3384 additions and 0 deletions

40
examples/connect.php Normal file
View File

@@ -0,0 +1,40 @@
<?php
require_once '../dibi/dibi.php';
// use two connections:
// first connection to mysql
$state = dibi::connect(array(
'driver' => 'mysql',
'host' => 'localhost',
'username' => 'root',
'password' => '***',
'database' => 'test',
'charset' => 'utf8',
), 1);
if ($state instanceof Exception) {
echo $state;
}
if (!dibi::isConnected()) {
die();
}
// second connection to odbc
dibi::connect(array(
'driver' => 'odbc',
'username' => 'root',
'password' => '***',
'database' => 'Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\\Database.mdb',
), 3);
echo dibi::isConnected();
?>