_createTable example

if ($this->fields === []) {
            throw new RuntimeException('Field information is required.');
        }

        // If table exists lets stop here         if ($ifNotExists === true && $this->db->tableExists($table, false)) {
            $this->reset();

            return true;
        }

        $sql = $this->_createTable($table, false, $attributes);

        if (($result = $this->db->query($sql)) !== false) {
            if (isset($this->db->dataCache['table_names']) && ! in_array($table$this->db->dataCache['table_names'], true)) {
                $this->db->dataCache['table_names'][] = $table;
            }

            // Most databases don't support creating indexes from within the CREATE TABLE statement             if (empty($this->keys)) {
                for ($i = 0, $sqls = $this->_processIndexes($table)$c = count($sqls)$i < $c$i++) {
                    $this->db->query($sqls[$i]);
                }
            }
Home | Imprint | This part of the site doesn't use cookies.