maybe_drop_column [ WordPress Function ]
maybe_drop_column ( $table_name, $column_name, $drop_ddl )
| Parameters: |
|
| Uses: |
|
| Returns: |
|
| Defined at: |
|
Soorgelijke functies: maybe_add_column, _maybe_update_plugins, _maybe_update_core, get_hidden_columns, make_db_current
Drop column from database table, if it exists.
Source
<?php
function maybe_drop_column($table_name, $column_name, $drop_ddl) {
global $wpdb;
foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {
if ($column == $column_name) {
//found it try to drop it.
$wpdb->query($drop_ddl);
// we cannot directly tell that whether this succeeded!
foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {
if ($column == $column_name) {
return false;
}
}
}
}
// else didn't find it
return true;
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- Docs for page install-helper.php
bool maybe_drop_column (string $table_name, string $column_name, string $ drop_ddl). string $table_name: Table name; string $column_name: Column name ...
phpdoc.wordpress.org - PHPXRef 0.7 : WordPress : /wp-admin/install-helper.php source
119 */ 120 function maybe_drop_column($table_name, $column_name, $ drop_ddl) { 121 global $wpdb; 122 foreach ($wpdb->get_col("DESC $ table_name",0) ...
phpxref.ftwr.co.uk - Changeset 373 for branches – Plogger
Apr 11, 2006 ... 80, function maybe_drop_column($table,$column) { .... 181, maybe_drop_column($config_table,"max_thumbnail_size"); ...
core.trac.plogger.org - install_functions.php in trunk/lib/plogger – Plogger
398, function maybe_drop_column($table,$column) {. 399, $sql = "DESCRIBE $ table";. 400, $res = mysql_query($sql);. 401, $found = false;. 402, while($row ...
core.trac.plogger.org