CodeIgniter Forums
SQL server connection not working - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: SQL server connection not working (/showthread.php?tid=90731)

Pages: 1 2


RE: SQL server connection not working - JustJohnQ - 04-25-2024

I can confirm it is not a bug. Adding the line:
PHP Code:
'port'        => ''

doesn't make a difference. A connection is made without problems.


RE: SQL server connection not working - falagar2k - 04-25-2024

(04-25-2024, 05:03 AM)JustJohnQ Wrote: I can confirm it is not a bug. Adding the line:
PHP Code:
'port'        => ''

doesn't make a difference. A connection is made without problems.

Maybe a difference between 4.4.6 and 4.5.1? Adding the port = '' line certainly breaks things for me.


RE: SQL server connection not working - kenjis - 04-25-2024

@JustJohnQ Thank you for checking!


RE: SQL server connection not working - JustJohnQ - 04-26-2024

Also tested on a fresh install of CI 4.5.1:
PHP Code:
public array $sqlsrv = [
        'DSN'        => '',
        'hostname'  => '127.0.0.1\sqlexpress',
        'username'  => 'uid',
        'password'  => 'pass',
        'database'  => 'db',
        'schema'    => 'dbo',
        'DBDriver'  => 'SQLSRV',
        'DBPrefix'  => '',
        'pConnect'  => false,
        'DBDebug'    => true,
        'charset'    => 'utf8',
        'swapPre'    => '',
        'encrypt'    => false,
        'failover'  => [],
        'port'        => '',
        'dateFormat' => [
            'date'    => 'Y-m-d',
            'datetime' => 'Y-m-d H:i:s',
            'time'    => 'H:i:s',
        ],
    ]; 


works without problems.


RE: SQL server connection not working - falagar2k - 04-26-2024

Strange. Thank you for checking and sorry if I caused inconvenience due to my ignorance.

Still very greatful for you help. It works for me now.


RE: SQL server connection not working - davis.lasis - 04-26-2024

port by default should be INTEGER not STRING