Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions system/Database/SQLSRV/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ public function connect(bool $persistent = false)
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);

Expand Down
1 change: 1 addition & 0 deletions user_guide_src/source/changelogs/v4.2.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,6 @@ Deprecations

Bugs Fixed
**********
- The SQLSRV driver ignores the port value from the config.

See the repo's `CHANGELOG.md <https://github.com/codeigniter4/CodeIgniter4/blob/develop/CHANGELOG.md>`_ for a complete list of bugs fixed.