public function dropTable($table_name) { $q = "DROP TABLE {$table_name};"; $re = $this->exec($q); if (!$re) { $path = path_run(); die("<hr>Database::createTable() : failed on create table {$table_name}. {$path}"); } return $this; }
public function getTables() { if (sys()->isCodeIgniter3()) { return $this->db->list_tables(); } else { if (sys()->isSapcms1()) { $tables = array(); $rows = $this->db->rows("SHOW TABLES"); if ($rows) { foreach ($rows as $row) { list($k, $v) = each($row); $tables[] = $v; } } return $tables; } } $path = path_run(2); die("DatabaseLayer::query()<hr>No framework support. No database connection.<hr>{$path}"); }
function test($code, $good = null, $bad = null) { static $_count_test = 0; global $global_test_error; $_count_test++; $tree = get_backtrace(); if ($code) { $path = path_run(2); echo "<span style='font-size:100%;color:#7f7c85;' title='{$good} {$path}'>{$_count_test}</span> "; } else { echo "<span style='font-size:160%;color:red;' title='{$bad}'>{$_count_test}</span> "; $global_test_error[] = $bad . $tree; } }