Closed andrew-m-p closed 1 year ago
Could not connect to sql server , I had to modify this function and add 'sqlsrv' to make it work
protected function dsn(): string { $dbtype = $this->config('dbtype'); $dbname = $this->config('dbname'); $host = $this->config('host');
if ($dbtype === 'sqlite') { $dsn = "sqlite:$dbname"; } else if ($dbtype === 'sqlsrv') { $dsn = $dbtype.":Server=".$this->config('host'); $dsn .= ";Database=".$this->config('database'); } else { $dsn = "$dbtype:host=$host"; if ($dbname !== '') $dsn .= ";dbname=$dbname"; if ($this->config('port')) $dsn .= ';port=' . $this->config('port'); if ($this->config('charset')) $dsn .= ';charset=' . $this->config('charset'); if ($this->config('unixSocket')) $dsn .= ';unix_socket=' . $this->config('unixSocket'); } return $dsn; }
Hi @andrew-m-p, thanks for pointing this out. I'll check out your issue.
This has been added now. Will be available from the next release
Could not connect to sql server , I had to modify this function and add 'sqlsrv' to make it work
protected function dsn(): string { $dbtype = $this->config('dbtype'); $dbname = $this->config('dbname'); $host = $this->config('host');