From d0aeb9e342d7d041a4e5f938c6e203303c2e58da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 13 May 2014 15:27:04 +0200 Subject: [PATCH] Use fetchValue directly as we do not need the query anyway MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michal Čihař --- libraries/relation.lib.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libraries/relation.lib.php b/libraries/relation.lib.php index 600cc8ce03..fcfd76e3d2 100644 --- a/libraries/relation.lib.php +++ b/libraries/relation.lib.php @@ -1233,13 +1233,10 @@ function PMA_getForeignData( $f_query_limit = isset($foreign_limit) ? $foreign_limit : ''; if (!empty($foreign_filter)) { - $res = $GLOBALS['dbi']->query( + $the_total = $GLOBALS['dbi']->fetchValue( 'SELECT COUNT(*)' . $f_query_from . $f_query_filter ); - if ($res) { - $the_total = $GLOBALS['dbi']->fetchValue($res); - @$GLOBALS['dbi']->freeResult($res); - } else { + if ($the_total === false) { $the_total = 0; } }