Skip to content

Commit

Permalink
Extended the MS SQL Server class with connection information in a pro…
Browse files Browse the repository at this point in the history
…perty
  • Loading branch information
sjstoelting committed Apr 5, 2012
1 parent 31cf394 commit ac1980e
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions mssql/ez_sql_mssql.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,10 @@ public function __construct($dbuser='', $dbpassword='', $dbname='', $dbhost='loc
* @return boolean
*/
public function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='localhost') {
$return_val = false;
if ( ! $this->connect($dbuser, $dbpassword, $dbhost,true) ) ;
else if ( ! $this->select($dbname) ) ;
else $return_val = true;
return $return_val;
else if ( ! $this->select($dbname) );

return $this->connected;
} // quick_connect

/**
Expand All @@ -124,7 +123,7 @@ public function quick_connect($dbuser='', $dbpassword='', $dbname='', $dbhost='l
* @return boolean
*/
public function connect($dbuser='', $dbpassword='', $dbhost='localhost') {
$return_val = false;
$this->connected = false;

// Must have a user and a password
if ( ! $dbuser )
Expand All @@ -139,7 +138,7 @@ public function connect($dbuser='', $dbpassword='', $dbhost='localhost') {
$this->dbuser = $dbuser;
$this->dbpassword = $dbpassword;
$this->dbhost = $dbhost;
$return_val = true;
$this->connected = true;
}

return $return_val;
Expand Down Expand Up @@ -170,10 +169,10 @@ public function select($dbname='') {
$this->show_errors ? trigger_error($str, E_USER_WARNING) : null;
} else {
$this->dbname = $dbname;
$return_val = true;
$this->connected = true;
}

return $return_val;
return $this->connected;
} // select

/**
Expand Down

0 comments on commit ac1980e

Please sign in to comment.