summaryrefslogtreecommitdiff
path: root/it_dbi.class
diff options
context:
space:
mode:
authorThomas BrĂ¼derli2010-04-21 12:27:27 +0000
committerThomas BrĂ¼derli2010-04-21 12:27:27 +0000
commitb55619a76c3a93e8ce7714e948afb8df74512dda (patch)
tree897d2cef117d21540df56a99f57ffd7c805176b4 /it_dbi.class
parentcf4e235bd13cff414a8e5146c179d3b4155e1d9c (diff)
downloaditools-b55619a76c3a93e8ce7714e948afb8df74512dda.tar.gz
itools-b55619a76c3a93e8ce7714e948afb8df74512dda.tar.bz2
itools-b55619a76c3a93e8ce7714e948afb8df74512dda.zip
Fix disabling of the syntax converter; allow to specify the db connection charset in it_dbi
Diffstat (limited to 'it_dbi.class')
-rw-r--r--it_dbi.class5
1 files changed, 5 insertions, 0 deletions
diff --git a/it_dbi.class b/it_dbi.class
index 9daf2c3..9ccfd48 100644
--- a/it_dbi.class
+++ b/it_dbi.class
@@ -33,6 +33,7 @@ class it_dbi
'pw' => "",
'safety' => 1, # 0= never die, 1=die if query invalid, 2=die also if no results
#'keyfield' => 'ID', # Don't set to null here, filled later by _get_field_info()
+ 'charset' => null, # client charset (requires MySQL 5.0.7 or later)
'classprefix' => "",
'getfieldinfo' => true, # do not read schema. only select() allowed
);
@@ -219,6 +220,10 @@ function _connect($p = array())
if (!(@mysql_select_db($p['db'], $this->_link)))
$this->_fatal("_connect(): can't select database \"{$p['db']}\"");
+
+ # set charset used for this connection
+ if ($p['charset'])
+ mysql_set_charset($p['charset'], $this->_link);
$state['link'] = $this->_link;
it_dbi::_state_put($dbid, $state, false); # Store only locally as link is not shared anyway