From a7c6487c4f8d982e8d18358d8de55a122e95a74c Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Mon, 10 Mar 2008 13:19:35 +0000 Subject: Fix warning when no tables exist, get rid of in_array() --- it_dbi.class | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/it_dbi.class b/it_dbi.class index 746b898..e755732 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -130,11 +130,12 @@ function createclass($p) if (!isset($dbi->_tables[$dbid])) { + $dbi->_tables[$dbid] = array(); for ($res = $dbi->query('SHOW TABLES'); $row = mysql_fetch_row($res);) - $dbi->_tables[$dbid][] = $row[0]; + $dbi->_tables[$dbid][$row[0]] = true; } - if (in_array($p['table'], $dbi->_tables[$dbid])) # Do not generate classes for non-existant tables + if ($dbi->_tables[$dbid][$p['table']]) # Do not generate classes for non-existant tables { $classname = $p['classprefix'] . $p['table']; -- cgit v1.2.3