ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:dictionary:dropcolumnsql

This is an old revision of the document!


dropColumnSql

See Also

Column Attributes Reference

Syntax
array dropColumnSql(
    string $tableName,
    string $columnName
    )

Description

The method dropColumnSql() creates the SQL statement necessary to drop an existing column given by $columnName from an existing table, given by ''$tableName'.

In order to actually create the column, the returned array must be passed to the executeSqlArray() method.

Usage

$dict = NewDataDictionary($db);
$sqlarray = $dict->dropColumnSql('ACT','ACTNOTES');
 
print_r($sqlarray);
 
/*
 * Prints
Array
(
    [0] => ALTER TABLE ACT DROP COLUMN ACTNOTES
)
 
*/
 
$dict->executeSqlArray($executeSqlArray);
v5/dictionary/dropcolumnsql.1440865929.txt.gz · Last modified: 2017/04/21 11:28 (external edit)