public function tableExists($tableName) {
        $cache = [];
        if (App::get()->cacheExists('mpf:PDOConnection:tableList')){
            $cache = App::get()->cacheValue('mpf:PDOConnection:tableList');
            if (!is_array($cache)){
                $cache = []; // a fix for old wrong values;
            }
            if (isset($cache[$tableName])){
                return $cache[$tableName];
            }
        }
        $res = $this->queryAssoc("SHOW TABLES LIKE :table", array(':table' => $tableName));
        $cache[$tableName] = (bool)$res;
        App::get()->cacheSet('mpf:PDOConnection:tableList', $cache);
        return (bool)$res;
    }
public function tableExists($tableName) {
        $cache = [];
        if (App::get()->cacheExists('mpf:PDOConnection:tableList')){
            $cache = App::get()->cacheValue('mpf:PDOConnection:tableList');
            if (!is_array($cache)){
                $cache = []; // a fix for old wrong values;
            }
            if (isset($cache[$tableName])){
                return $cache[$tableName];
            }
        }
        $res = $this->queryAssoc("SHOW TABLES LIKE :table", array(':table' => $tableName));
        $cache[$tableName] = (bool)$res;
        App::get()->cacheSet('mpf:PDOConnection:tableList', $cache);
        return (bool)$res;
    }
public function tableExists ( $ tableName ) { $ cache = [ ] ; if ( App :: get ( ) -> cacheExists ( 'mpf:PDOConnection:tableList' ) ) { $ cache = App :: get ( ) -> cacheValue ( 'mpf:PDOConnection:tableList' ) ; if ( ! is_array ( $ cache ) ) { $ cache = [ ] ; // a fix for old wrong values; } if ( isset ( $ cache [ $ tableName ] ) ) { return $ cache [ $ tableName ] ; } } $ res = $ this -> queryAssoc ( "SHOW TABLES LIKE :table" , array ( ':table' => $ tableName ) ) ; $ cache [ $ tableName ] = ( bool ) $ res ; App :: get ( ) -> cacheSet ( 'mpf:PDOConnection:tableList' , $ cache ) ; return ( bool ) $ res ; }
Check if selected table exists.
@param $tableName
@return bool
@throws \Exception
Check if selected table exists .