示例#1
0
<?php
// Init
error_reporting(E_ALL & ~E_STRICT);
header('Content-type: text/plain');
$start = microtime(1);
if ( isset($_GET['mysql']) ) {
        require '../db_mysql.php';
        $db = db_mysql::open(array('user' => $_GET['user'], 'pass' => $_GET['pass'], 'db' => $_GET['db']));
}
else {
        require '../db_sqlite.php';
        $db = db_sqlite::open(array('database' => './stuff.sqlite3'));
}
示例#2
0
<?php

require DB_LIB_PATH . '/db_mysql.php';
$db = db_mysql::open(array('user' => DB_USER, 'pass' => DB_PASS, 'db' => DB_NAME));
if (!$db) {
    exit('No connecto!');
}