diff options
-rw-r--r-- | it_dbi.class | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/it_dbi.class b/it_dbi.class index 09557de..60619a4 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -71,6 +71,9 @@ function it_dbi($p = array(), $query = null) if ($p['table']) # Standard use: create a table object { + if (!isset($GLOBALS['it_dbi'])) + new it_dbi; + $this->_p += $this->_get_field_info(); # Get $this->_fields and p[keyfield, autoincrement, randomid] if (is_array($query)) @@ -78,7 +81,7 @@ function it_dbi($p = array(), $query = null) elseif (isset($query)) $this->read($query); } - elseif (!$GLOBALS['it_dbi']) # Special use w/o table: create singleton to store settings + else $GLOBALS['it_dbi'] =& $this; } |