Revision 1442
Added by Dietmar over 13 years ago
class.database.php | ||
---|---|---|
189 | 189 |
*/ |
190 | 190 |
public function field_add($table_name, $field_name, $description) |
191 | 191 |
{ |
192 |
if( !$this->field_exists($field_name, $table_name) )
|
|
192 |
if( !$this->field_exists($table_name, $field_name) )
|
|
193 | 193 |
{ // add new field into a table |
194 | 194 |
$sql = 'ALTER TABLE `'.$table_name.'` ADD '.$field_name.' '.$description.' '; |
195 | 195 |
$query = $this->query($sql); |
196 | 196 |
$this->set_error(mysql_error()); |
197 | 197 |
if( !$this->is_error() ) |
198 | 198 |
{ |
199 |
return ( $this->field_exists($field_name, $table_name) ) ? true : false;
|
|
199 |
return ( $this->field_exists($table_name, $field_name) ) ? true : false;
|
|
200 | 200 |
} |
201 | 201 |
}else |
202 | 202 |
{ |
Also available in: Unified diff
bug fixed in class.database.php methode field_add in call field_exists
update search, pls test, (Tks to Thorn)