diff options
author | Christian Schneider | 2008-03-10 13:19:35 +0000 |
---|---|---|
committer | Christian Schneider | 2008-03-10 13:19:35 +0000 |
commit | a7c6487c4f8d982e8d18358d8de55a122e95a74c (patch) | |
tree | 17a2fa17f02c8ccbab8a66f6d1e4b332428cc47b /it_dbi.class | |
parent | 5d6c8e0f8d08d791585fcd48c5511442c220b891 (diff) | |
download | itools-a7c6487c4f8d982e8d18358d8de55a122e95a74c.tar.gz itools-a7c6487c4f8d982e8d18358d8de55a122e95a74c.tar.bz2 itools-a7c6487c4f8d982e8d18358d8de55a122e95a74c.zip |
Fix warning when no tables exist, get rid of in_array()
Diffstat (limited to 'it_dbi.class')
-rw-r--r-- | it_dbi.class | 5 |
1 files 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']; |