From: <var...@us...> - 2012-11-15 13:54:42
|
Revision: 8476 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8476&view=rev Author: vargenau Date: 2012-11-15 13:54:31 +0000 (Thu, 15 Nov 2012) Log Message: ----------- Simpler SQL query Modified Paths: -------------- trunk/lib/wikilens/RatingsDb.php Modified: trunk/lib/wikilens/RatingsDb.php =================================================================== --- trunk/lib/wikilens/RatingsDb.php 2012-11-15 13:38:31 UTC (rev 8475) +++ trunk/lib/wikilens/RatingsDb.php 2012-11-15 13:54:31 UTC (rev 8476) @@ -383,12 +383,8 @@ if (isset($pagename)) $where .= " AND"; $where .= " dimension=$dimension"; } - //$dbh = &$this->_dbi; extract($dbi->_table_names); - $query = "SELECT AVG(ratingvalue) as avg" - . " FROM $rating_tbl r, $page_tbl p " - . $where - . " GROUP BY raterpage"; + $query = "SELECT AVG(ratingvalue) as avg FROM $rating_tbl r, $page_tbl p " . $where . " GROUP BY raterpage"; $result = $dbi->_dbh->query($query); $iter = new $this->iter_class($this, $result); $row = $iter->next(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |