added "LoginTimeout"
This commit is contained in:
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @desc A simple and convenient php sqlsrv class
|
* @desc A simple and convenient php sqlsrv class
|
||||||
* @author Yaseng WwW.Yaseng.Me []
|
* @author Originaly made by Yaseng WwW.Yaseng.Me, now maintained and update by Sebastien Plante
|
||||||
* v1.3
|
* @version v1.4
|
||||||
* @link
|
* @link https://gitea.urbanghetto.net/nka/php_sqlsrv_class
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class sqlsrv
|
class sqlsrv
|
||||||
@@ -19,7 +19,7 @@ class sqlsrv
|
|||||||
//connection
|
//connection
|
||||||
function __construct($server, $user, $pass, $dbname)
|
function __construct($server, $user, $pass, $dbname)
|
||||||
{
|
{
|
||||||
$this->conn = @sqlsrv_connect($server, array('UID' => $user, 'PWD' => $pass, 'Database' => $dbname));
|
$this->conn = @sqlsrv_connect($server, array('UID' => $user, 'PWD' => $pass, 'Database' => $dbname, 'LoginTimeout' => 10));
|
||||||
if ($this->conn === false) {
|
if ($this->conn === false) {
|
||||||
$this->error_log[] = sqlsrv_errors();
|
$this->error_log[] = sqlsrv_errors();
|
||||||
throw new Exception($this->error_log[0][0]["message"]);
|
throw new Exception($this->error_log[0][0]["message"]);
|
||||||
|
|||||||
Reference in New Issue
Block a user