Welcome Guest, Not a member yet? Register   Sign In
Connecting to SQL Server database
#1

I have some database connections in database.php that work fine. I want to create a connection on the fly without going through database.php because I don't know what the database will be until I connect.

Previously I could use $dbconn=mssql://username@instance/dbname

Then use $seldb=$this->load->database($dbconn,true);

Can I assume that by doing mssql it is trying to use the old mssql connection? It fails with an error:

Type: Error

Message: Call to undefined function mssql_connect()

I don't see anything in my code explicitly referencing mssql_connect. Any help would be appreciated. 
Reply
#2

The old mssql database driver still use mssql_connect() but it looks like this function no longer exist since a very long time: https://stackoverflow.com/a/42536672

If  you still want to use SQL Server with CI3, somebody will need to update the mssql driver. And if you want to use it with CI4, somebody will need to write a new driver because it's currently not supported: https://codeigniter4.github.io/userguide...ight=mssql
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply




Theme © iAndrew 2016 - Forum software by © MyBB