Skip to content
Newer
Older
100644 16 lines (13 sloc) 748 Bytes
6b4ee48 @vrana Autocomplete for big foreign keys
authored May 4, 2011
1 <?php
ef0cb38 @vrana Support Editor
authored Aug 19, 2012
2 if ($_GET["script"] == "kill") {
3 $connection->query("KILL " . (+$_POST["kill"]));
4
5 } elseif (list($table, $id, $name) = $adminer->_foreignColumn(column_foreign_keys($_GET["source"]), $_GET["field"])) {
24e66c2 @vrana Respect numbers in autocomplete
authored May 5, 2011
6 $result = $connection->query("SELECT $id, $name FROM " . table($table) . " WHERE " . (ereg('^[0-9]+$', $_GET["value"]) ? "$id = $_GET[value] OR " : "") . "$name LIKE " . q("$_GET[value]%") . " ORDER BY 2 LIMIT 11");
6b4ee48 @vrana Autocomplete for big foreign keys
authored May 4, 2011
7 for ($i=0; $i < 10 && ($row = $result->fetch_row()); $i++) {
8 echo "<a href='" . h(ME . "edit=" . urlencode($table) . "&where" . urlencode("[" . bracket_escape(idf_unescape($id)) . "]") . "=" . urlencode($row[0])) . "'>" . h($row[1]) . "</a><br>\n";
9 }
10 if ($i == 10) {
11 echo "...\n";
12 }
13 }
14
15 exit; // don't print footer
Something went wrong with that request. Please try again.