Skip to content

Commit

Permalink
Removed OW referenced for SQLServer references
Browse files Browse the repository at this point in the history
  • Loading branch information
a1phanumeric authored Jan 17, 2025
1 parent d94dea0 commit e74de62
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions DBPDO.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@ class DBPDO
private $dbhost;
private $dbuser;
private $dbpass;
private $orderwise;
private $sqlserver;

public static function getInstance($dbhost, $dbname, $dbuser, $dbpass, $orderwise = false)
public static function getInstance($dbhost, $dbname, $dbuser, $dbpass, $sqlserver = false)
{
if (self::$instance === null) {
self::$instance = new self($dbhost, $dbname, $dbuser, $dbpass, $orderwise);
self::$instance = new self($dbhost, $dbname, $dbuser, $dbpass, $sqlserver);
}
return self::$instance;
}

function __construct($dbhost = '', $dbname = '', $dbuser = '', $dbpass = '', $orderwise = false)
function __construct($dbhost = '', $dbname = '', $dbuser = '', $dbpass = '', $sqlserver = false)
{
$this->dbhost = $dbhost;
$this->dbname = $dbname;
$this->dbuser = $dbuser;
$this->dbpass = $dbpass;
$this->orderwise = $orderwise;
$this->sqlserver = $sqlserver;
$this->connect();
}

Expand All @@ -49,7 +49,7 @@ function prep_query($query)
function connect()
{
if (!$this->pdo) {
if($this->orderwise){
if($this->sqlserver){
$dsn = 'sqlsrv:Server=' . $this->dbhost . ';Database=' . $this->dbname . ';Encrypt=no';
}else{
$dsn = 'mysql:dbname=' . $this->dbname . ';host=' . $this->dbhost . ';charset=utf8mb4';
Expand All @@ -58,7 +58,7 @@ function connect()
$password = $this->dbpass;

try {
if($this->orderwise){
if($this->sqlserver){
$this->pdo = new PDO($dsn, $user, $password);
}else{
$this->pdo = new PDO($dsn, $user, $password, array(PDO::ATTR_PERSISTENT => true));
Expand Down

0 comments on commit e74de62

Please sign in to comment.