@@ -15,23 +15,23 @@ class DBPDO
15
15
private $ dbhost ;
16
16
private $ dbuser ;
17
17
private $ dbpass ;
18
- private $ orderwise ;
18
+ private $ sqlserver ;
19
19
20
- public static function getInstance ($ dbhost , $ dbname , $ dbuser , $ dbpass , $ orderwise = false )
20
+ public static function getInstance ($ dbhost , $ dbname , $ dbuser , $ dbpass , $ sqlserver = false )
21
21
{
22
22
if (self ::$ instance === null ) {
23
- self ::$ instance = new self ($ dbhost , $ dbname , $ dbuser , $ dbpass , $ orderwise );
23
+ self ::$ instance = new self ($ dbhost , $ dbname , $ dbuser , $ dbpass , $ sqlserver );
24
24
}
25
25
return self ::$ instance ;
26
26
}
27
27
28
- function __construct ($ dbhost = '' , $ dbname = '' , $ dbuser = '' , $ dbpass = '' , $ orderwise = false )
28
+ function __construct ($ dbhost = '' , $ dbname = '' , $ dbuser = '' , $ dbpass = '' , $ sqlserver = false )
29
29
{
30
30
$ this ->dbhost = $ dbhost ;
31
31
$ this ->dbname = $ dbname ;
32
32
$ this ->dbuser = $ dbuser ;
33
33
$ this ->dbpass = $ dbpass ;
34
- $ this ->orderwise = $ orderwise ;
34
+ $ this ->sqlserver = $ sqlserver ;
35
35
$ this ->connect ();
36
36
}
37
37
@@ -49,7 +49,7 @@ function prep_query($query)
49
49
function connect ()
50
50
{
51
51
if (!$ this ->pdo ) {
52
- if ($ this ->orderwise ){
52
+ if ($ this ->sqlserver ){
53
53
$ dsn = 'sqlsrv:Server= ' . $ this ->dbhost . ';Database= ' . $ this ->dbname . ';Encrypt=no ' ;
54
54
}else {
55
55
$ dsn = 'mysql:dbname= ' . $ this ->dbname . ';host= ' . $ this ->dbhost . ';charset=utf8mb4 ' ;
@@ -58,7 +58,7 @@ function connect()
58
58
$ password = $ this ->dbpass ;
59
59
60
60
try {
61
- if ($ this ->orderwise ){
61
+ if ($ this ->sqlserver ){
62
62
$ this ->pdo = new PDO ($ dsn , $ user , $ password );
63
63
}else {
64
64
$ this ->pdo = new PDO ($ dsn , $ user , $ password , array (PDO ::ATTR_PERSISTENT => true ));
0 commit comments