From 2d9887993cc2c5dbbc22106c07906220bf33836f Mon Sep 17 00:00:00 2001 From: rvelices Date: Tue, 11 Feb 2014 21:47:44 +0000 Subject: arrayfromquery optimizations: move double if from inside loop to outside + use directly mysqli calls to avoid function call overhead for every row retrieved from db git-svn-id: http://piwigo.org/svn/trunk@27336 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/functions_tag.inc.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'include/functions_tag.inc.php') diff --git a/include/functions_tag.inc.php b/include/functions_tag.inc.php index 6e047c502..8744cb5fb 100644 --- a/include/functions_tag.inc.php +++ b/include/functions_tag.inc.php @@ -70,7 +70,7 @@ SELECT tag_id, COUNT(DISTINCT(it.image_id)) AS counter ).' GROUP BY tag_id ;'; - $tag_counters = simple_hash_from_query($query, 'tag_id', 'counter'); + $tag_counters = query2array($query, 'tag_id', 'counter'); if ( empty($tag_counters) ) { @@ -233,7 +233,7 @@ SELECT id } $query .= "\n".(empty($order_by) ? $conf['order_by'] : $order_by); - return array_from_query($query, 'id'); + return query2array($query, null, 'id'); } /** @@ -320,13 +320,7 @@ SELECT * WHERE '. implode( ' OR ', $where_clauses); - $result = pwg_query($query); - $tags = array(); - while ($row = pwg_db_fetch_assoc($result)) - { - $tags[] = $row; - } - return $tags; + return query2array($query); } ?> \ No newline at end of file -- cgit v1.2.3