function &Connect($info = NULL) { $GLOBALS["ADODB_FETCH_MODE"] = ADODB_FETCH_BOTH; $GLOBALS["ADODB_COUNTRECS"] = FALSE; if (EW_USE_ADODB) { if (EW_USE_MYSQLI) { $conn = ADONewConnection('mysqli'); } else { $conn = ADONewConnection('mysqlt'); } } else { $conn = new mysqlt_driver_ADOConnection(); } $conn->debug = $this->Debug; $conn->debug_echo = FALSE; if (!$info) { $info = array("host" => $this->Host, "port" => $this->Port, "user" => $this->Username, "pass" => $this->Password, "db" => $this->DbName); } $conn->port = intval($info["port"]); if ($this->Debug) { $conn->raiseErrorFn = $GLOBALS["EW_ERROR_FN"]; } $conn->Connect($info["host"], $info["user"], $info["pass"], $info["db"]); if ($this->MySqlCharset != "") { $conn->Execute("SET NAMES '" . $this->MySqlCharset . "'"); } $conn->raiseErrorFn = ''; return $conn; }
function &Connect($info = NULL) { $GLOBALS["ADODB_FETCH_MODE"] = ADODB_FETCH_BOTH; $conn = new mysqlt_driver_ADOConnection(); $conn->debug = $this->Debug; $conn->debug_echo = FALSE; if (!$info) { $info = array("host" => $this->Host, "port" => $this->Port, "user" => $this->Username, "pass" => $this->Password, "db" => $this->DbName); } $conn->port = intval($info["port"]); if ($this->Debug) { $conn->raiseErrorFn = 'ew_ErrorFn'; } $conn->Connect($info["host"], $info["user"], $info["pass"], $info["db"]); if ($this->MySqlCharset != "") { $conn->Execute("SET NAMES '" . $this->MySqlCharset . "'"); } $conn->raiseErrorFn = ''; return $conn; }
function &ew_Connect() { $GLOBALS["ADODB_FETCH_MODE"] = ADODB_FETCH_BOTH; $conn = new mysqlt_driver_ADOConnection(); $conn->debug = EW_DEBUG_ENABLED; $conn->debug_echo = FALSE; $info = array("host" => EW_CONN_HOST, "port" => EW_CONN_PORT, "user" => EW_CONN_USER, "pass" => EW_CONN_PASS, "db" => EW_CONN_DB); // Database loading event Database_Connecting($info); $conn->port = intval($info["port"]); $conn->raiseErrorFn = 'ew_ErrorFn'; $conn->Connect($info["host"], $info["user"], $info["pass"], $info["db"]); if (EW_MYSQL_CHARSET != "") { $conn->Execute("SET NAMES '" . EW_MYSQL_CHARSET . "'"); } $conn->raiseErrorFn = ''; return $conn; }
function &ew_Connect() { $object = new mysqlt_driver_ADOConnection(); if (defined("EW_DEBUG_ENABLED")) { $object->debug = TRUE; } $object->port = EW_CONN_PORT; $object->raiseErrorFn = 'ew_ErrorFn'; $object->Connect(EW_CONN_HOST, EW_CONN_USER, EW_CONN_PASS, EW_CONN_DB); if (EW_MYSQL_CHARSET != "") { $object->Execute("SET NAMES '" . EW_MYSQL_CHARSET . "'"); } $object->raiseErrorFn = ''; return $object; }