Elastic: Use select() instead of SELECT
This commit is contained in:
parent
6664b0fb7e
commit
21cc6ceb59
|
@ -89,8 +89,11 @@ if ($_POST["save"]) {
|
|||
$select = array("*");
|
||||
}
|
||||
if ($select) {
|
||||
$rows = get_rows("SELECT" . limit(implode(", ", $select) . " FROM " . table($TABLE), " WHERE $where", (isset($_GET["select"]) ? 2 : 1)));
|
||||
$row = (isset($_GET["select"]) && count($rows) != 1 ? null : reset($rows));
|
||||
$result = $driver->select($TABLE, $select, array($where), $select, array(), (isset($_GET["select"]) ? 2 : 1), 0);
|
||||
$row = $result->fetch_assoc();
|
||||
if (isset($_GET["select"]) && (!$row || $result->fetch_assoc())) { // $result->num_rows != 1 isn't available in all drivers
|
||||
$row = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -169,10 +169,10 @@ username.form['auth[driver]'].onchange();
|
|||
*/
|
||||
function selectQuery($query) {
|
||||
global $jush;
|
||||
return "<p><code class='jush-$jush'>" . h(str_replace("\n", " ", $query)) . "</code>"
|
||||
return ($_GET["edit"] != "" ? "" : "<p><code class='jush-$jush'>" . h(str_replace("\n", " ", $query)) . "</code>"
|
||||
. (support("sql") ? " <a href='" . h(ME) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a>" : "")
|
||||
. "</p>" // </p> - required for IE9 inline edit
|
||||
;
|
||||
);
|
||||
}
|
||||
|
||||
/** Description of a row in a table
|
||||
|
|
Loading…
Reference in a new issue