function GetTablesList() { static $tables = null; if ($tables == null) { $cmd = new DBCommand("SHOW TABLES FROM @dbname"); $cmd->Add('@dbname', DB_TableName, GetConfigValue("db_database")); $res = DB::GetAll($cmd); $tables = array(); foreach ($res as $row) { $tables[] = GetFirstValue($row); } } return $tables; }
function GetOne(&$cmd) { $res = $this->InternalQuery($cmd); if ($res === false) { return null; } if ($res === true) { if (DEBUG_ENABLE) { DebugWrite("'" . htmlspecialchars($cmd->cmdText) . "' is not a SELECT query", MSG_ERROR); } return array(); } if ($row = mysql_fetch_assoc($res)) { $fld = GetFirstValue($row); } else { $fld = null; } mysql_free_result($res); return $fld; }