* @param string User name
* @param string Password
* @param string Database name
- * @param bool Use p-connect?
*
* @return bool Result of connect
*/
- public function connect($server, $user, $password, $database, $pconnect)
+ public function connect($server, $user, $password, $database)
{
if ($this->dblink == false)
{
- $this->dblink = $this->{($pconnect ? '_connect' : '_pConnect')}($server, $user, $password, $database);
+ $this->dblink = $this->_connect($server, $user, $password, $database);
if ($this->dblink == false)
{
*/
protected abstract function _connect($server, $user, $password, $database);
- /**
- * Abstract function that returns a database link after establishing a connection. This just
- * calls the function and does not do any checking
- *
- * @param string Server name
- * @param string User name
- * @param string Password
- * @param string Database name
- *
- * @return resource Database link
- */
- protected abstract function _pConnect($server, $user, $password, $database);
-
// ###################################################################
/**
* Send a query to the open database link
return $link;
}
-
- // ###################################################################
- /**
- * Wrapper: mysql_pconnect
- */
- protected function _pConnect($server, $user, $password, $database)
- {
- $link = @mysql_pconnect($server, $user, $password);
- if ($link)
- {
- $this->_selectDb($database, $link);
- }
-
- return $link;
- }
-
+
// ###################################################################
/**
* Opens a connection to the specified database name
return mysqli_connect($server, $user, $password, $database);
}
- // ###################################################################
- /**
- * Wrapper: mysql_pconnect
- */
- protected function _pConnect($server, $user, $password, $database)
- {
- return mysqli_connect($server, $user, $password, $database);
- }
-
// ###################################################################
/**
* Wrapper: mysql_query
return pg_connect("host='$server' port={$this->port} user='$user' password='$password' dbname='$database'");
}
- // ###################################################################
- /**
- * Wrapper: pg_pconnect
- */
- protected function _pConnect($server, $user, $password, $database)
- {
- return pg_pconnect("host='$server' port={$this->port} user='$user' password='$password' dbname='$database'");
- }
-
// ###################################################################
/**
* Wrapper: pg_escape_string