• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Database Connection

#1
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

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

$db['default'] = array(
    'dsn'   => '',
    'hostname' => '192.168.1.55',
    'username' => 'sa',
    'password' => 'admin1234',
    'database' => 'MyDatabase',
    'dbdriver' => 'sqlsrv',
    'dbprefix' => '',
    'pconnect' => TRUE,
    '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
);

this is my database connection and working fine...

but when i copy folder to run at another computer it's now working


error :
unable to connect to your database server using the provided setting.

i try to change
    'db_debug' => FALSE,


it's working but some CI function not working
like  : num_rows() , etc..

i use xampp, and sql server database
Reply

#2
try changing the value of 'hostname' => 'ip set on the computer' or 'hostname' => 'localhost'
Reply

#3
i have tried nothing change.

my php version 7.3.2
xampp 3.2.2
Reply

#4
show your database
Reply

#5
the problem is not in database

because my application running well

the problem is when i copy to another computer
Reply

#6
Done..
the problem is ODBC Driver to Sql Server
Reply

#7
Did you try this?

7 Steps to make SQL Server and Codeigniter Works
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.