public function add_table($tablename = null, $table_structure = null)
    {
        if (empty($tablename) || empty($table_structure)) return false;

        if (!is_string($table_structure))
            $table_structure_str = join(',', self::build_fields_array( $table_structure ) );
        else
            $table_structure_str = $table_structure;
        if (!self::table_exists($tablename)) {
            $query = "CREATE TABLE $tablename ($table_structure_str);";
    /*
            $results = $this->db->queryExec($query, $err);
            if ($err) trigger_error( "Can not create table '$tablename' [$err]!", E_USER_ERROR );
    */
            $results = $this->query($query, null, 'queryExec');
            $this->addCachedQuery( $query, $results );
        }
        return self::table_exists($tablename);
    }
public function add_table($tablename = null, $table_structure = null)
    {
        if (empty($tablename) || empty($table_structure)) return false;

        if (!is_string($table_structure))
            $table_structure_str = join(',', self::build_fields_array( $table_structure ) );
        else
            $table_structure_str = $table_structure;
        if (!self::table_exists($tablename)) {
            $query = "CREATE TABLE $tablename ($table_structure_str);";
    /*
            $results = $this->db->queryExec($query, $err);
            if ($err) trigger_error( "Can not create table '$tablename' [$err]!", E_USER_ERROR );
    */
            $results = $this->query($query, null, 'queryExec');
            $this->addCachedQuery( $query, $results );
        }
        return self::table_exists($tablename);
    }
public function add_table ( $ tablename = null , $ table_structure = null ) { if ( empty ( $ tablename ) || empty ( $ table_structure ) ) return false ; if ( ! is_string ( $ table_structure ) ) $ table_structure_str = join ( ',' , self :: build_fields_array ( $ table_structure ) ) ; else $ table_structure_str = $ table_structure ; if ( ! self :: table_exists ( $ tablename ) ) { $ query = "CREATE TABLE $tablename ($table_structure_str);" ; /*
            $results = $this->db->queryExec($query, $err);
            if ($err) trigger_error( "Can not create table '$tablename' [$err]!", E_USER_ERROR );
    */ $ results = $ this -> query ( $ query , null , 'queryExec' ) ; $ this -> addCachedQuery ( $ query , $ results ) ; } return self :: table_exists ( $ tablename ) ; }
Add a table in the database

@param string $tablename The new table name
@param array $table_structure An array of the table fields
@return bool TRUE if the table had been created, FALSE if an error occurred
Add a table in the database