public function createTable($nameWithoutPrefix, $createDefinition)
    {
        $statement = sprintf("CREATE TABLE `%s` ( %s ) ENGINE=%s DEFAULT CHARSET=utf8 ;",
                             Common::prefixTable($nameWithoutPrefix),
                             $createDefinition,
                             $this->getTableEngine());

        try {
            Db::exec($statement);
        } catch (Exception $e) {
            // mysql code error 1050:table already exists
            // see bug #153 https://github.com/piwik/piwik/issues/153
            if (!$this->getDb()->isErrNo($e, '1050')) {
                throw $e;
            }
        }
    }
public function createTable($nameWithoutPrefix, $createDefinition)
    {
        $statement = sprintf("CREATE TABLE `%s` ( %s ) ENGINE=%s DEFAULT CHARSET=utf8 ;",
                             Common::prefixTable($nameWithoutPrefix),
                             $createDefinition,
                             $this->getTableEngine());

        try {
            Db::exec($statement);
        } catch (Exception $e) {
            // mysql code error 1050:table already exists
            // see bug #153 https://github.com/piwik/piwik/issues/153
            if (!$this->getDb()->isErrNo($e, '1050')) {
                throw $e;
            }
        }
    }
public function createTable ( $ nameWithoutPrefix , $ createDefinition ) { $ statement = sprintf ( "CREATE TABLE `%s` ( %s ) ENGINE=%s DEFAULT CHARSET=utf8 ;" , Common :: prefixTable ( $ nameWithoutPrefix ) , $ createDefinition , $ this -> getTableEngine ( ) ) ; try { Db :: exec ( $ statement ) ; } catch ( Exception $ e ) { // mysql code error 1050:table already exists // see bug #153 https://github.com/piwik/piwik/issues/153 if ( ! $ this -> getDb ( ) -> isErrNo ( $ e , '1050' ) ) { throw $ e ; } } }
Creates a new table in the database.

@param string $nameWithoutPrefix The name of the table without any piwik prefix.
@param string $createDefinition  The table create definition, see the "MySQL CREATE TABLE" specification for
more information.
@throws \Exception
Creates a new table in the database .