" . lang('Unable to select the table') . ($fields ? "" : ": " . mysql_error()) . ".
\n"; } else { echo "\n"; echo "\n"; $result = mysql_query("SELECT SQL_CALC_FOUND_ROWS " . implode(", ", array_map('idf_escape', $columns)) . " FROM " . idf_escape($_GET["select"]) . ($where ? " WHERE " . implode(" AND ", $where) : "") . ($order ? " ORDER BY " . implode(", ", $order) : "") . (strlen($limit) ? " LIMIT " . intval($limit) . " OFFSET " . ($limit * $_GET["page"]) : "")); if (!mysql_num_rows($result)) { echo " \n"; } else { $found_rows = mysql_result(mysql_query(" SELECT FOUND_ROWS()"), 0); // space for mysql.trace_mode $indexes = indexes($_GET["select"]); $foreign_keys = array(); foreach (foreign_keys($_GET["select"]) as $foreign_key) { foreach ($foreign_key[2] as $val) { $foreign_keys[$val][] = $foreign_key; } } $childs = array(); $result1 = mysql_query("SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE REFERENCED_TABLE_SCHEMA = '" . mysql_real_escape_string($_GET["db"]) . "' AND REFERENCED_TABLE_NAME = '" . mysql_real_escape_string($_GET["select"]) . "' ORDER BY ORDINAL_POSITION"); while ($row1 = mysql_fetch_assoc($result1)) { $childs[$row1["CONSTRAINT_NAME"]][0] = $row1["TABLE_SCHEMA"]; $childs[$row1["CONSTRAINT_NAME"]][1] = $row1["TABLE_NAME"]; $childs[$row1["CONSTRAINT_NAME"]][2][] = $row1["REFERENCED_COLUMN_NAME"]; $childs[$row1["CONSTRAINT_NAME"]][3][] = $row1["COLUMN_NAME"]; } mysql_free_result($result1); echo "" . implode(" | ", array_map('htmlspecialchars', array_keys($row))) . " | " . lang('Action') . " |
---|---|---|
' . lang('edit') . ''; //! views can be unupdatable foreach ($childs as $child) { echo ' ' . htmlspecialchars($child[1]) . ''; } echo " | "; echo "
" . lang('Page') . ":\n"; for ($i=0; $i < $found_rows / $limit; $i++) { echo ($i == $_GET["page"] ? $i + 1 : '' . ($i + 1) . "") . "\n"; } echo "
\n"; } } mysql_free_result($result); }