sqlsrv_configure example

// If the username and password are both empty, assume this is a         // 'Windows Authentication Mode' connection.         if (empty($connection['UID']) && empty($connection['PWD'])) {
            unset($connection['UID']$connection['PWD']);
        }

        if (strpos($this->hostname, ',') === false && $this->port !== '') {
            $this->hostname .= ', ' . $this->port;
        }

        sqlsrv_configure('WarningsReturnAsErrors', 0);
        $this->connID = sqlsrv_connect($this->hostname, $connection);

        if ($this->connID !== false) {
            // Determine how identifiers are escaped             $query = $this->query('SELECT CASE WHEN (@@OPTIONS | 256) = @@OPTIONS THEN 1 ELSE 0 END AS qi');
            $query = $query->getResultObject();

            $this->_quoted_identifier = empty($query) ? false : (bool) $query[0]->qi;
            $this->escapeChar         = ($this->_quoted_identifier) ? '"' : ['[', ']'];

            return $this->connID;
        }
Home | Imprint | This part of the site doesn't use cookies.