Skip to content

Instantly share code, notes, and snippets.

@rohman
Created April 17, 2013 23:21
Show Gist options
  • Save rohman/5408574 to your computer and use it in GitHub Desktop.
Save rohman/5408574 to your computer and use it in GitHub Desktop.
CodeIgniter ODBC Connection
<?php
$active_group = 'default';
$active_record = FALSE;
$db['default']['hostname'] = 'Driver={SQL Server};Server=127.0.0.1;Database=databasenya; Uid=sa;Pwd=sa;';
$db['default']['username'] = 'sa';
$db['default']['password'] = 'sa';
$db['default']['database'] = 'databasenya';
$db['default']['dbdriver'] = 'odbc';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = FALSE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
?>
@wcoarite
Copy link

imran300 did you make the connection? I have the same problem

@BrunoPastorello
Copy link

Oi tudo bem, não sei se tem a ver, estou conectando no sql server igual esta string no codeigniter, mas os registros com caracteres especias esta dando "?" sabe me ajudar?

Cara, sei que faz muito tempo, mas você conseguiu resolver isso?

@dianadipratama1
Copy link

@rohman how with codeigniter with MySQL ODBC 5.1 Driver ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment