public function dropColumn($name)
    {
        $colTypes = $this->getCols(true);
        // check if column exists
        if (!in_array($name, array_keys($colTypes))) return true;
        if (preg_match('/sqlite2?/', $this->db->driver())) {
            // SQlite does not support drop column directly
            $this->rebuild_cmd['drop'][] = $name;
        } else {
            $quotedTable = $this->db->quotekey($this->name);
            $quotedColumn = $this->db->quotekey($name);
            $cmd = array(
                'mysql' =>
                    "ALTER TABLE $quotedTable DROP $quotedColumn;",
                'pgsql|odbc|ibm|mssql|sybase|dblib|sqlsrv' =>
                    "ALTER TABLE $quotedTable DROP COLUMN $quotedColumn;",
            );
            if (preg_match('/mssql|sybase|dblib|sqlsrv/', $this->db->driver()))
                $this->suppress=true;
            $this->queries[] = $this->findQuery($cmd);
        }
    }
public function dropColumn($name)
    {
        $colTypes = $this->getCols(true);
        // check if column exists
        if (!in_array($name, array_keys($colTypes))) return true;
        if (preg_match('/sqlite2?/', $this->db->driver())) {
            // SQlite does not support drop column directly
            $this->rebuild_cmd['drop'][] = $name;
        } else {
            $quotedTable = $this->db->quotekey($this->name);
            $quotedColumn = $this->db->quotekey($name);
            $cmd = array(
                'mysql' =>
                    "ALTER TABLE $quotedTable DROP $quotedColumn;",
                'pgsql|odbc|ibm|mssql|sybase|dblib|sqlsrv' =>
                    "ALTER TABLE $quotedTable DROP COLUMN $quotedColumn;",
            );
            if (preg_match('/mssql|sybase|dblib|sqlsrv/', $this->db->driver()))
                $this->suppress=true;
            $this->queries[] = $this->findQuery($cmd);
        }
    }
public function dropColumn ( $ name ) { $ colTypes = $ this -> getCols ( true ) ; // check if column exists if ( ! in_array ( $ name , array_keys ( $ colTypes ) ) ) return true ; if ( preg_match ( '/sqlite2?/' , $ this -> db -> driver ( ) ) ) { // SQlite does not support drop column directly $ this -> rebuild_cmd [ 'drop' ] [ ] = $ name ; } else { $ quotedTable = $ this -> db -> quotekey ( $ this -> name ) ; $ quotedColumn = $ this -> db -> quotekey ( $ name ) ; $ cmd = array ( 'mysql' => "ALTER TABLE $quotedTable DROP $quotedColumn;" , 'pgsql|odbc|ibm|mssql|sybase|dblib|sqlsrv' => "ALTER TABLE $quotedTable DROP COLUMN $quotedColumn;" , ) ; if ( preg_match ( '/mssql|sybase|dblib|sqlsrv/' , $ this -> db -> driver ( ) ) ) $ this -> suppress = true ; $ this -> queries [ ] = $ this -> findQuery ( $ cmd ) ; } }
removes a column from a table
@param string $name
@return bool
removes a column from a table