/*
*pgsql类
*/
class pgdb {
public $pdo;
public static $PDOInstance;
public $config;
public $data;
public $filed = '*';
public $table;
public $limit;
public $order;
public $where;
public $left;
const LOGIN = 7;
const USER = 1;
const GROUP = 2;
const USERGROUP = 3;
const LOG = 6;
定数waring = 1;
const error = 2; /db.json"), true);
$config = $this->config;
$host = $config["data_base"]["db_host"];
$dbname = $config["data_base"][ "db_name"];
$port = $config["data_base"]["db_port"];
$username = $config["data_base"]["db_user"];
$password = $config["data_base"] ["db_pwd"];
if ($config["data_base"]["db_host"] != 'localhost') {
$hosturl = "host=$host;";
}
試してみてください
{
self:: $PDOInstance = new PDO("pgsql:"
. $hosturl
. "port=$port;"
. "dbname=$dbname;"
, $username
, $password
, array(
PDO::ATTR_PERSISTENT => true,
)
);
} catch (Exception $ex) {
header("Content-type : text/html; charset=utf-8");
$error = "データ库初期化失败、すでに制断されました。
抓取的异常栈例:
" . print_r($ex, true) . "";