src/Codeception/Module/WPDb.php
public function grabBlogTableNames($blogId)
    {
        $table_prefix = "{$this->tablePrefix}{$blogId}_";
        $query = 'SELECT table_name '
                 . 'FROM information_schema.tables '
                 . "WHERE table_schema = ? and table_name like '{$table_prefix}%'";
        $databaseName = $this->_getDriver()->executeQuery('select database()', [])->fetchColumn();
        return $this->_getDriver()->executeQuery($query, [$databaseName])->fetchAll(PDO::FETCH_COLUMN);
    }
public function grabBlogTableNames($blogId)
    {
        $table_prefix = "{$this->tablePrefix}{$blogId}_";
        $query = 'SELECT table_name '
                 . 'FROM information_schema.tables '
                 . "WHERE table_schema = ? and table_name like '{$table_prefix}%'";
        $databaseName = $this->_getDriver()->executeQuery('select database()', [])->fetchColumn();
        return $this->_getDriver()->executeQuery($query, [$databaseName])->fetchAll(PDO::FETCH_COLUMN);
    }
public function grabBlogTableNames ( $ blogId ) { $ table_prefix = "{$this->tablePrefix}{$blogId}_" ; $ query = 'SELECT table_name ' . 'FROM information_schema.tables ' . "WHERE table_schema = ? and table_name like '{$table_prefix}%'" ; $ databaseName = $ this -> _getDriver ( ) -> executeQuery ( 'select database()' , [ ] ) -> fetchColumn ( ) ; return $ this -> _getDriver ( ) -> executeQuery ( $ query , [ $ databaseName ] ) -> fetchAll ( PDO :: FETCH_COLUMN ) ; }
Returns a list of tables for a blog ID.

@example
```php
$blogId = $I->haveBlogInDatabase('test');
$tables = $I->grabBlogTableNames($blogId);
$options = array_filter($tables, function($tableName){
return str_pos($tableName, 'options') !== false;
});
```

@param int $blogId The ID of the blog to fetch the tables for.

@return array An array of tables for the blog, it does not include the tables common to all blogs; an empty array
if the tables for the blog do not exist.

@throws \Exception If there is any error while preparing the query.
Returns a list of tables for a blog ID .