From 453c639c53c6c49a0225d3cf5cc61f27db22609a Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 13 Feb 2019 15:54:40 +0100 Subject: [PATCH] optimized. events_has_extended_info Former-commit-id: 805b80f1a9e09425b0e5710906886ae39e791753 --- pandora_console/include/functions_events.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 71780ed4e5..8ffabc5ad4 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -2622,10 +2622,9 @@ function events_has_extended_info(int $id_event) { return (bool) db_get_value_sql( sprintf( - ' - SELECT count(*) as "n" - FROM tevent_extended WHERE id_evento=%d - ', + 'SELECT count(*) FROM ( + SELECT * as "n" + FROM tevent_extended WHERE id_evento=%d LIMIT 1) t', $id_event ) );