From: Alessandro Frangioni Date: Tue, 28 Jun 2016 08:25:39 +0000 (+0200) Subject: Added support for binary foreign keys selection on edit X-Git-Tag: v4.3.0~59 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=5f26d3a1b8aaedccf6e6889c3052b0b1c378f622;p=adminer.git Added support for binary foreign keys selection on edit --- diff --git a/plugins/edit-foreign.php b/plugins/edit-foreign.php index 4b78c43c..0bb825a2 100644 --- a/plugins/edit-foreign.php +++ b/plugins/edit-foreign.php @@ -26,7 +26,11 @@ class AdminerEditForeign { $id = $foreignKey["target"][0]; $options = &$values[$target][$id]; if (!$options) { - $options = array("" => "") + get_vals("SELECT " . idf_escape($id) . " FROM " . table($target) . " ORDER BY 1"); + $column = idf_escape($id); + if (preg_match('~binary~', $field["type"])) { + $column = "HEX($column)"; + } + $options = array("" => "") + get_vals("SELECT $column FROM " . table($target) . " ORDER BY 1"); if ($this->_limit && count($options) - 1 > $this->_limit) { return; }