summaryrefslogtreecommitdiff
path: root/dbi.class
diff options
context:
space:
mode:
Diffstat (limited to 'dbi.class')
-rw-r--r--dbi.class12
1 files changed, 6 insertions, 6 deletions
diff --git a/dbi.class b/dbi.class
index 9426971..5666d28 100644
--- a/dbi.class
+++ b/dbi.class
@@ -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))