private function fetchColumns() {
        $qry = 'SELECT c.column_name as colName, c.column_default as colDefault,
			c.is_nullable as nullable, c.column_type as colType, c.extra, c.column_key as colKey,
                        c.character_set_name as charset, c.collation_name as collation';
        $qry .= ', d.index_name as indexName';
        $qry .=' FROM INFORMATION_SCHEMA.COLUMNS c ' .
                'LEFT JOIN INFORMATION_SCHEMA.STATISTICS d'
                . ' ON c.column_name = d.column_name AND d.table_schema="' . $this->connection->getDBName() . '" AND d.table_name="' . $this->name . '" ' .
                'WHERE c.table_schema="' . $this->connection->getDBName() . '" AND c.table_name="' . $this->name . '"';

        $columns = $this->connection->doPrepare($qry);
        if (is_bool($columns)) return;

        foreach ($columns as $column) {
            $this->columns[$column['colName']] = $column;
            if (in_array($column['colKey'],
                            array('MUL', 'UNI', 'PRI', 'SPA', 'FUL'))) {
                $this->indexes[$column['colName']] = $column['indexName'];
            }
        }
    }
private function fetchColumns() {
        $qry = 'SELECT c.column_name as colName, c.column_default as colDefault,
			c.is_nullable as nullable, c.column_type as colType, c.extra, c.column_key as colKey,
                        c.character_set_name as charset, c.collation_name as collation';
        $qry .= ', d.index_name as indexName';
        $qry .=' FROM INFORMATION_SCHEMA.COLUMNS c ' .
                'LEFT JOIN INFORMATION_SCHEMA.STATISTICS d'
                . ' ON c.column_name = d.column_name AND d.table_schema="' . $this->connection->getDBName() . '" AND d.table_name="' . $this->name . '" ' .
                'WHERE c.table_schema="' . $this->connection->getDBName() . '" AND c.table_name="' . $this->name . '"';

        $columns = $this->connection->doPrepare($qry);
        if (is_bool($columns)) return;

        foreach ($columns as $column) {
            $this->columns[$column['colName']] = $column;
            if (in_array($column['colKey'],
                            array('MUL', 'UNI', 'PRI', 'SPA', 'FUL'))) {
                $this->indexes[$column['colName']] = $column['indexName'];
            }
        }
    }
private function fetchColumns ( ) { $ qry = 'SELECT c.column_name as colName, c.column_default as colDefault,
			c.is_nullable as nullable, c.column_type as colType, c.extra, c.column_key as colKey,
                        c.character_set_name as charset, c.collation_name as collation' ; $ qry .= ', d.index_name as indexName' ; $ qry .= ' FROM INFORMATION_SCHEMA.COLUMNS c ' . 'LEFT JOIN INFORMATION_SCHEMA.STATISTICS d' . ' ON c.column_name = d.column_name AND d.table_schema="' . $ this -> connection -> getDBName ( ) . '" AND d.table_name="' . $ this -> name . '" ' . 'WHERE c.table_schema="' . $ this -> connection -> getDBName ( ) . '" AND c.table_name="' . $ this -> name . '"' ; $ columns = $ this -> connection -> doPrepare ( $ qry ) ; if ( is_bool ( $ columns ) ) return ; foreach ( $ columns as $ column ) { $ this -> columns [ $ column [ 'colName' ] ] = $ column ; if ( in_array ( $ column [ 'colKey' ] , array ( 'MUL' , 'UNI' , 'PRI' , 'SPA' , 'FUL' ) ) ) { $ this -> indexes [ $ column [ 'colName' ] ] = $ column [ 'indexName' ] ; } } }
Fetches all columns of the table and their information
Fetches all columns of the table and their information