Connection of SQL SERVER 2012 with Codeigniter

0

Hello everyone, I am developing a system with CI, Mysql and Sql Server 2012, I am configuring in php 5.6.30 and I put all the exemptions in php.ini and nothing I get this error when I pick it up

and that's in my databse, php

$db['sqlserver'] = array(
'dsn' => '',
'hostname' => '10.5.50.28',
'username' => 'sa',
'password' => 'SQLserver2012',
'database' => 'BD_UGEL_IMAGING',
'dbdriver' => 'sqlsrv',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE

);

and this is my modal

class caja_model extends CI_Model {

function __construct() {
    parent::__construct();
    $this->db_caja = $this->load->database('caja', TRUE);
    $this->db_resoluciones = $this->load->database('resoluciones', TRUE);
    $this->db_sqlserver = $this->load->database('sqlserver', TRUE);
}

The funny thing is my partner's machine if he raises

    
asked by Joel More F. 10.04.2017 в 17:55
source

2 answers

1

Hi, I lost more than a day with that problem and in the end I found that my Windows 7 was not complete, the "Microsoft® ODBC Driver 11 for SQL Server®" was missing. Once installed, the error message that came out was removed. .

Leave the settings as they are because they are fine. Install the pack and ready press F5 or reload the page and wonder everything works.

the download link is:

link

Even though I think it might change, put the google "Microsoft® ODBC Driver 11 for SQL Server".

eye this is in local form or in own Server. In shared hosting I do not know how it will work.

Greetings.

    
answered by 06.06.2017 в 20:33
0

It seems that php has changed some things in the latest versions due to security issues.

At the moment I am just like you and what I use is what they explain in this video

link

    
answered by 21.04.2017 в 22:33