Jump to content

Need Help. Codeigniter 3.1.3 & SQLServer Connection

Go to solution Solved by C2dan88,

PHP is not recognising the sqlsrv_connect function. To use the sqlserv_*() functions you need to enable the sqlserv PHP extension

 

Try

http://bendustries.co/wp/setting-up-xampp-to-work-with-mssql/

http://php.net/manual/en/sqlsrv.requirements.php

Hi guys, i need help connecting Codeigniter 3.1.3 to SQL Server 2016, I never use SQL Server before. Huh

 

I'm running XAMPP v3.2.2 with PHP 7.1.1 with Thread Safety Enabled
SQL Server 2016 on Windows 10
i have installed ODBC driver 13
and have copy of Microsoft Driver for PHP for SQL Server 4.0 to my PHP extension and registering it to php.ini file.

the problem is, i keep getting this error when trying to connect to SQL Server 2016.

An uncaught Exception was encountered

Type: Error

Message: Call to undefined function sqlsrv_connect()

Filename: C:\xampp\htdocs\sideka\system\database\drivers\sqlsrv\sqlsrv_driver.php

Line Number: 144

Backtrace:

File: C:\xampp\htdocs\sideka\index.php
Line: 315
Function: require_once


And this is my database.php settings

$active_group = 'default';
$query_builder = TRUE;

$db['default'] = array(
    'dsn'    => '',
    'hostname' => 'tcp:127.0.0.1,1433',
    'port' => '1433',
    'username' => 'sa',
    'password' => 'a1a2a3',
    'database' => 'sideka',
    'dbdriver' => 'sqlsrv',
    'dbprefix' => '',
    'pconnect' => FALSE,
    'db_debug' => FALSE,
    'cache_on' => FALSE,
    'cachedir' => '',
    'char_set' => 'utf8',
    'dbcollat' => 'utf8_general_ci',
    'swap_pre' => '',
    'encrypt' => FALSE,
    'compress' => FALSE,
    'stricton' => FALSE,
    'failover' => array(),
    'save_queries' => TRUE
);

Did anyone know to solve the problem? Any help is appreciated. Rolleyes

Link to post
Share on other sites

PHP is not recognising the sqlsrv_connect function. To use the sqlserv_*() functions you need to enable the sqlserv PHP extension

 

Try

http://bendustries.co/wp/setting-up-xampp-to-work-with-mssql/

http://php.net/manual/en/sqlsrv.requirements.php

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×