From b85067b16670306e204fd0e74e1744d5d39a53f8 Mon Sep 17 00:00:00 2001 From: Alexey Melnichuk Date: Tue, 29 Mar 2016 19:00:59 +0300 Subject: [PATCH] Fix. Display extension on MySQL. Problem that ```SQL select (select count(*) as num_rows ...) ``` is not the same as ```SQL select (select count(*) ...) as num_rows ``` I think problem may be on SQLite too. --- app/extensions/extensions.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/extensions/extensions.php b/app/extensions/extensions.php index 90ec5a6412..2b5a076218 100644 --- a/app/extensions/extensions.php +++ b/app/extensions/extensions.php @@ -62,11 +62,11 @@ require_once "resources/paging.php"; //get total extension count from the database $sql = "select "; - $sql .= "(select count(*) as num_rows from v_extensions where domain_uuid = '".$_SESSION['domain_uuid']."') "; + $sql .= "(select count(*) from v_extensions where domain_uuid = '".$_SESSION['domain_uuid']."') as num_rows "; if ($db_type == "pgsql") { - $sql .= ",(select count(*) as numeric_extensions from v_extensions "; + $sql .= ",(select count(*) from v_extensions "; $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; - $sql .= "and extension ~ '^[0-9]+$')"; + $sql .= "and extension ~ '^[0-9]+$') as numeric_extensions"; } $prep_statement = $db->prepare($sql); if ($prep_statement) {