then problem I am having is that when I get data out of database everything is fine, but when I write data with special symbols to database I get special symbols coded.
ex. When I write name (1.5), ie I get the name ( 1.5 & # 4 1 ; , ie (without spaces). But when I get from database base everything is fine and name (1.5), ie is shown.
The problem is that my search with special symbols does not work.
here are the configurations.
database.config:
$active_group = 'default';
$active_record = TRUE;
$db['default']['hostname'] = '10.87.4.147';
$db['default']['username'] = 'sa';
$db['default']['password'] = 'Q!w2e3r4';
$db['default']['database'] = 'rrr';
$db['default']['dbdriver'] = 'mssql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = FALSE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'latin1';
$db['default']['dbcollat'] = 'latin1_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
as you’ve noticed my database collation is SQL_Latin1_General_CP1_CI_AS.
I’ve tried setting values to:
$db[‘default’][‘char_set’] = ‘utf8’;
$db[‘default’][‘dbcollat’] = ‘utf8_general_ci’;
and:
$db[‘default’][‘char_set’] = ‘utf16’;
$db[‘default’][‘dbcollat’] = ‘utf16_general_ci’;
Any ideas how to write data with special symbols or have my search working. The search is simple, I get string, put it in SQL LIKE statement and return the values.
If ever anyone will face the same problem, here is the solution:
I’ve used
And then inserted $newname. Works like a charm.