diff options
author | rvelices <rv-github@modusoptimus.com> | 2014-02-11 21:47:44 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2014-02-11 21:47:44 +0000 |
commit | 2d9887993cc2c5dbbc22106c07906220bf33836f (patch) | |
tree | c9b07b57c5ab93d8be9356105e317c051267e8c4 /include/functions_tag.inc.php | |
parent | 78621a34878093fe2fed7bcf76ac61aca9acb249 (diff) |
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
Diffstat (limited to 'include/functions_tag.inc.php')
-rw-r--r-- | include/functions_tag.inc.php | 12 |
1 files changed, 3 insertions, 9 deletions
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 |