added "LoginTimeout"

This commit is contained in:
2023-05-23 15:22:09 -04:00
parent ae968a6b3e
commit cca0b7a81a

View File

@@ -1,10 +1,10 @@
<?php
/**
* @desc A simple and convenient php sqlsrv class
* @author Yaseng WwW.Yaseng.Me []
* v1.3
* @link
* @desc A simple and convenient php sqlsrv class
* @author Originaly made by Yaseng WwW.Yaseng.Me, now maintained and update by Sebastien Plante
* @version v1.4
* @link https://gitea.urbanghetto.net/nka/php_sqlsrv_class
*/
class sqlsrv
@@ -19,7 +19,7 @@ class sqlsrv
//connection
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) {
$this->error_log[] = sqlsrv_errors();
throw new Exception($this->error_log[0][0]["message"]);