Skip to content

Instantly share code, notes, and snippets.

@ShenXuGongZi
Last active August 29, 2015 14:00
Show Gist options
  • Save ShenXuGongZi/11167634 to your computer and use it in GitHub Desktop.
Save ShenXuGongZi/11167634 to your computer and use it in GitHub Desktop.
db.php
db.<?php
require './lib/dibi.min.php';
// DB
try {
$dsn = new PDO("mysql:host=localhost;dbname=runtime", 'root', '****', array(
PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"
));
dibi::connect(array(
'driver' => 'pdo',
'pdo' => $dsn,
'lazy' => true,
'profiler' => array(
'run' => TRUE,
),
));
$dibi = true;
} catch (Exception $e) {
echo $e->getMessage();
exit();
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment