set_filenames( array( 'tplSqlbrowserTableShowTabledataEntry' => './tpl/sqlbrowser/table/show_tabledata_entry.tpl' ) ); /* * Fetch and check _GET variables */ $validModes = array('VIEW', 'EDIT', 'NEW'); $db = isset($_GET['db']) ? base64_decode($_GET['db']) : $config['db_actual']; $tablename = isset($_GET['tablename']) ? base64_decode($_GET['tablename']) : ''; $rowKey = isset($_GET['key']) ? base64_decode($_GET['key']) : ''; $mode = 'VIEW'; if (isset($_GET['do'])) { $mode =strtoupper((string) $_GET['do']); } if (!in_array($mode, $validModes)) { $mode = 'VIEW'; } $tableInfos = getExtendedFieldInfo($db, $tablename); $tplSqlbrowserTableShowTabledataEntry->assign_vars( array( 'DB_NAME' => $db, 'TABLE_NAME' => $tablename, 'DB_NAME_URLENCODED' => base64_encode($db), 'TABLE_NAME_URLENCODED' => base64_encode($tablename) ) ); $row = array(); if ($mode == 'VIEW' || $mode == 'EDIT') { $dbo->selectDb($db); $query = "SELECT * FROM `$tablename` WHERE $rowKey"; $row = $dbo->query($query, MsdDbFactory::ARRAY_ASSOC); if (false === $row || !isset($row[0])) { //TODO clean error handling echo "