* Add DB Column */
(
$table, $column_name, $column_type)
| 262 | * Add DB Column |
| 263 | */ |
| 264 | public static function add_db_column( |
| 265 | $table, $column_name, $column_type){ |
| 266 | |
| 267 | // SQL. |
| 268 | $sql = 'ALTER TABLE `'.$table.'` '; |
| 269 | $sql.= 'ADD COLUMN '.$column_name.' '.$column_type.';'; |
| 270 | $params = array(); |
| 271 | |
| 272 | // Query |
| 273 | $result = self::query($sql, $params, false); |
| 274 | |
| 275 | // Result |
| 276 | if(!$result) |
| 277 | throw new Exception('Cannot add "'.$column_name.'" to "'.$table.'" with type "'.$column_type.'"'); |
| 278 | |
| 279 | } |
| 280 | |
| 281 | /** |
| 282 | * Get Joined DB |
no test coverage detected