Zeile 1334 | Zeile 1334 |
---|
*/ function drop_column($table, $column) {
|
*/ function drop_column($table, $column) {
|
return $this->write_query("ALTER TABLE {$this->table_prefix}{$table} DROP {$column}");
| $column = trim($column, '`');
return $this->write_query("ALTER TABLE {$this->table_prefix}{$table} DROP `{$column}`");
|
}
/** * Adds a column
|
}
/** * Adds a column
|
*
| *
|
* @param string $table The table * @param string $column The column name * @param string $definition the new column definition
|
* @param string $table The table * @param string $column The column name * @param string $definition the new column definition
|
* @return mysqli_result */
| * @return mysqli_result */
|
function add_column($table, $column, $definition)
|
function add_column($table, $column, $definition)
|
{ return $this->write_query("ALTER TABLE {$this->table_prefix}{$table} ADD {$column} {$definition}"); }
| { $column = trim($column, '`');
return $this->write_query("ALTER TABLE {$this->table_prefix}{$table} ADD `{$column}` {$definition}"); }
|
/** * Modifies a column *
| /** * Modifies a column *
|
Zeile 1359 | Zeile 1363 |
---|
* @return mysqli_result */ function modify_column($table, $column, $new_definition)
|
* @return mysqli_result */ function modify_column($table, $column, $new_definition)
|
{ return $this->write_query("ALTER TABLE {$this->table_prefix}{$table} MODIFY {$column} {$new_definition}");
| { $column = trim($column, '`');
return $this->write_query("ALTER TABLE {$this->table_prefix}{$table} MODIFY `{$column}` {$new_definition}");
|
}
/**
| }
/**
|
Zeile 1374 | Zeile 1380 |
---|
*/ function rename_column($table, $old_column, $new_column, $new_definition) {
|
*/ function rename_column($table, $old_column, $new_column, $new_definition) {
|
return $this->write_query("ALTER TABLE {$this->table_prefix}{$table} CHANGE {$old_column} {$new_column} {$new_definition}");
| $old_column = trim($old_column, '`'); $new_column = trim($new_column, '`');
return $this->write_query("ALTER TABLE {$this->table_prefix}{$table} CHANGE `{$old_column}` `{$new_column}` {$new_definition}");
|
}
/**
| }
/**
|