TO BE WATCHED: Optimize db to web transfer - limit query to one result in api_get_item_visibility()

1.9.x
Yannick Warnier 11 years ago
parent ca4671c705
commit f7a25debf5
  1. 2
      main/inc/lib/main_api.lib.php

@ -3132,7 +3132,7 @@ function api_get_item_visibility($_course, $tool, $id, $session=0)
tool = '$tool' AND
ref = $id AND
(id_session = $session OR id_session = 0)
ORDER BY id_session DESC, lastedit_date DESC";
ORDER BY id_session DESC, lastedit_date DESC LIMIT 1";
$res = Database::query($sql);
if ($res === false || Database::num_rows($res) == 0) { return -1; }
$row = Database::fetch_array($res);

Loading…
Cancel
Save