public function create()
    {
        if (!mysql_query(
            "CREATE DATABASE IF NOT EXISTS `{$this->dbName}`",
            $this->link
        )
        ) {
            throw new Klarna_DatabaseException(
                'Failed to create! ('.mysql_error().')'
            );
        }

        $create = mysql_query(
            "CREATE TABLE IF NOT EXISTS `{$this->dbName}`.`{$this->dbTable}` (
                `eid` int(10) unsigned NOT NULL,
                `id` int(10) unsigned NOT NULL,
                `type` tinyint(4) NOT NULL,
                `description` varchar(255) NOT NULL,
                `months` int(11) NOT NULL,
                `interestrate` decimal(11,2) NOT NULL,
                `invoicefee` decimal(11,2) NOT NULL,
                `startfee` decimal(11,2) NOT NULL,
                `minamount` decimal(11,2) NOT NULL,
                `country` int(11) NOT NULL,
                `expire` int(11) NOT NULL,
                KEY `id` (`id`)
            )", $this->link
        );

        if (!$create) {
            throw new Klarna_DatabaseException(
                'Table not existing, failed to create! ('.mysql_error().')'
            );
        }
    }
public function create()
    {
        if (!mysql_query(
            "CREATE DATABASE IF NOT EXISTS `{$this->dbName}`",
            $this->link
        )
        ) {
            throw new Klarna_DatabaseException(
                'Failed to create! ('.mysql_error().')'
            );
        }

        $create = mysql_query(
            "CREATE TABLE IF NOT EXISTS `{$this->dbName}`.`{$this->dbTable}` (
                `eid` int(10) unsigned NOT NULL,
                `id` int(10) unsigned NOT NULL,
                `type` tinyint(4) NOT NULL,
                `description` varchar(255) NOT NULL,
                `months` int(11) NOT NULL,
                `interestrate` decimal(11,2) NOT NULL,
                `invoicefee` decimal(11,2) NOT NULL,
                `startfee` decimal(11,2) NOT NULL,
                `minamount` decimal(11,2) NOT NULL,
                `country` int(11) NOT NULL,
                `expire` int(11) NOT NULL,
                KEY `id` (`id`)
            )", $this->link
        );

        if (!$create) {
            throw new Klarna_DatabaseException(
                'Table not existing, failed to create! ('.mysql_error().')'
            );
        }
    }
public function create ( ) { if ( ! mysql_query ( "CREATE DATABASE IF NOT EXISTS `{$this->dbName}`" , $ this -> link ) ) { throw new Klarna_DatabaseException ( 'Failed to create! (' . mysql_error ( ) . ')' ) ; } $ create = mysql_query ( "CREATE TABLE IF NOT EXISTS `{$this->dbName}`.`{$this->dbTable}` (
                `eid` int(10) unsigned NOT NULL,
                `id` int(10) unsigned NOT NULL,
                `type` tinyint(4) NOT NULL,
                `description` varchar(255) NOT NULL,
                `months` int(11) NOT NULL,
                `interestrate` decimal(11,2) NOT NULL,
                `invoicefee` decimal(11,2) NOT NULL,
                `startfee` decimal(11,2) NOT NULL,
                `minamount` decimal(11,2) NOT NULL,
                `country` int(11) NOT NULL,
                `expire` int(11) NOT NULL,
                KEY `id` (`id`)
            )" , $ this -> link ) ; if ( ! $ create ) { throw new Klarna_DatabaseException ( 'Table not existing, failed to create! (' . mysql_error ( ) . ')' ) ; } }
Initialize the DB by creating the necessary database tables.

@throws Klarna_DatabaseException If tables could not be created

@return void
Initialize the DB by creating the necessary database tables .