2011-05-04 13:53:26 +00:00
< ? php
2012-08-20 06:25:23 +00:00
if ( $_GET [ " script " ] == " kill " ) {
2014-11-25 02:17:43 +00:00
$connection -> query ( " KILL " . number ( $_POST [ " kill " ]));
2012-08-20 06:25:23 +00:00
2018-02-19 22:04:27 +00:00
} elseif ( list ( $table , $id , $name ) = $adminer -> _foreignColumn ( column_foreign_keys ( $_GET [ " source " ]), $_GET [ " field " ])) { // complete
2013-05-24 01:31:48 +00:00
$limit = 11 ;
2013-07-24 23:26:41 +00:00
$result = $connection -> query ( " SELECT $id , $name FROM " . table ( $table ) . " WHERE " . ( preg_match ( '~^[0-9]+$~' , $_GET [ " value " ]) ? " $id = $_GET[value] OR " : " " ) . " $name LIKE " . q ( " $_GET[value] % " ) . " ORDER BY 2 LIMIT $limit " );
2013-05-24 01:31:48 +00:00
for ( $i = 1 ; ( $row = $result -> fetch_row ()) && $i < $limit ; $i ++ ) {
2011-05-04 13:53:26 +00:00
echo " <a href=' " . h ( ME . " edit= " . urlencode ( $table ) . " &where " . urlencode ( " [ " . bracket_escape ( idf_unescape ( $id )) . " ] " ) . " = " . urlencode ( $row [ 0 ])) . " '> " . h ( $row [ 1 ]) . " </a><br> \n " ;
}
2013-05-24 01:31:48 +00:00
if ( $row ) {
2011-05-04 13:53:26 +00:00
echo " ... \n " ;
}
}
exit ; // don't print footer