-
blunde
Newbie
-
Posts: 4
Threads: 1
Joined: Nov 2014
Reputation:
0
11-20-2014, 12:38 PM
(This post was last modified: 12-02-2014, 05:46 AM by blunde.
Edit Reason: SOLVED
)
Hi
Trying to use CodeIgniter with odbc to a old MSSQL server.
When fetching the results some of the fields are truncated.
Ex. ["Frame9Val"]=> string(3) "13" --- should show 135
Ex. ["Frame1BVal"]=> string(3) "2�" --- should show 255
Any idea why this is happening?
It's working when using plain PDO outside CI
\B
-
blunde
Newbie
-
Posts: 4
Threads: 1
Joined: Nov 2014
Reputation:
0
(11-20-2014, 01:54 PM)Rufnex Wrote: Looks like a charset problem? have you checked the database config (char_set, dbcollat)?
Yes, tried different settings without any luck.
-
blunde
Newbie
-
Posts: 4
Threads: 1
Joined: Nov 2014
Reputation:
0
(11-20-2014, 03:27 PM)Rufnex Wrote: Are you on windows or a unix server?
CentOS linux using FreeTDS and unixODBC
-
Rufnex
Chuck Norris Mode - Former CI Council
-
Posts: 511
Threads: 7
Joined: Oct 2014
Reputation:
35
I use CI3 with the following settings and with FreeTDS without any problems:
PHP Code: $db['default'] = array( 'dsn' => '', 'hostname' => 'ip_or_name', 'username' => 'user', 'password' => 'password', 'database' => '', 'dbdriver' => 'mssql', 'dbprefix' => '', 'pconnect' => TRUE, 'db_debug' => TRUE, 'cache_on' => TRUE, 'cachedir' => 'application/cache', 'char_set' => 'utf8', 'dbcollat' => 'utf8_general_ci', 'swap_pre' => '', 'autoinit' => TRUE, 'encrypt' => FALSE, 'compress' => FALSE, 'stricton' => FALSE, 'failover' => array(), 'save_queries' => TRUE );
-
blunde
Newbie
-
Posts: 4
Threads: 1
Joined: Nov 2014
Reputation:
0
12-02-2014, 05:45 AM
Thank you so much! This was the fix I needed
(11-21-2014, 04:57 AM)Rufnex Wrote: I use CI3 with the following settings and with FreeTDS without any problems:
PHP Code: $db['default'] = array( 'dsn' => '', 'hostname' => 'ip_or_name', 'username' => 'user', 'password' => 'password', 'database' => '', 'dbdriver' => 'mssql', 'dbprefix' => '', 'pconnect' => TRUE, 'db_debug' => TRUE, 'cache_on' => TRUE, 'cachedir' => 'application/cache', 'char_set' => 'utf8', 'dbcollat' => 'utf8_general_ci', 'swap_pre' => '', 'autoinit' => TRUE, 'encrypt' => FALSE, 'compress' => FALSE, 'stricton' => FALSE, 'failover' => array(), 'save_queries' => TRUE );
|