diff options
-rw-r--r-- | dbi.class | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -67,6 +67,11 @@ function it_dbi($config = array(), $query = null) $this->_dbid = "$this->_db/$this->_server/$this->_user"; + $this->_defaults = ""; + foreach($config as $key => $value) + if ($key != 'createclasses') + $this->_defaults .= "'$key' => '".strtr($value, array('\'' => '\\\'', '$' => '\\$'))."', "; + if ($this->_createclasses) { $this->_connect(); @@ -74,16 +79,11 @@ function it_dbi($config = array(), $query = null) if (!($tables = mysql_list_tables($this->_db, $this->_link))) $this->_fatal("it_dbi(): can't list on tables \"$this->_db\": " . mysql_error($this->_link)); - $this->_defaults = ""; - foreach($config as $key => $value) - if ($key != 'createclasses') - $this->_defaults .= "'$key' => '".strtr($value, array('\'' => '\\\'', '$' => '\\$'))."', "; - for ($i = 0; $i < mysql_num_rows($tables); $i++) $this->createclass(mysql_tablename($tables, $i)); } - if (!$GLOBALS['it_dbi']) + if (!$GLOBALS['it_dbi'] && !$config['table']) $GLOBALS['it_dbi'] =& $this; if (isset($query)) |