conn = new PDO("sqlsrv:server=$this->server; Database=$this->database", $this->user, $this->pwd); $this->conn->setAttribute(PDO::SQLSRV_ATTR_QUERY_TIMEOUT, 60); // value in seconds $this->conn->setAttribute(PDO::SQLSRV_ATTR_ENCODING, PDO::SQLSRV_ENCODING_UTF8); } catch (Exception $e) { die(print_r($e->getMessage())); } } function __destruct() { $this->conn = null; } public function getConnection() { return $this->conn; } public function getTop() { return $this->top; } } ?>