MCPcopy Create free account
hub / github.com/EqualifyEverything/equalify / add_db_column

Method add_db_column

models/db.php:264–279  ·  view source on GitHub ↗

* Add DB Column */

(
        $table, $column_name, $column_type)

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 1

queryMethod · 0.95

Tested by

no test coverage detected