Welcome Guest, Not a member yet? Register   Sign In
resolving config issues

on my prod server I can connect to a ms sql database like so
$this->con = odbc_connect('al-barran', 'a_user', 'a_password') or die(odbc_errormsg());

I can perform queries normally thur this functionality. If I read the documentation/reviewing the code... ci should be able to perform this type of connection if I can get my settings correct.

So in my ci database config I have
$db['default']['db_debug'] = TRUE;
$db['default']['hostname'] = "";
$db['default']['username'] = "a_user";
// the password provided has a $ so changed double to single
$db['default']['password'] = 'a_password';
$db['default']['database'] = "al-barran";
$db['default']['dbdriver'] = "odbc";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";

added the following to my controller
ini_set('display_errors', 'On');
define('MP_DB_DEBUG', true);

Unfortunately I am still getting the generic 'A Database Error Occurred'. Any advice would be appreciated. Either for displaying what is wrong or point out where I have err'd in my config.

[eluser]Oscar Dias[/eluser]
I never used ODBC, but don't you need a hostname in your config?

The only time I have used ODBC is on desktop applications myself. I provided the odbc_connect() method as I know that it works. BUT I am at a loss as to why it works.


ok I resolved my issue.... my odbc connection is named the same as the database. Good grief it is the simple things.... embarrassed.

Theme © iAndrew 2016 - Forum software by © MyBB