[33095] trunk/www/includes/common.inc
jmpp at macports.org
jmpp at macports.org
Thu Jan 17 13:01:35 PST 2008
Revision: 33095
http://trac.macosforge.org/projects/macports/changeset/33095
Author: jmpp at macports.org
Date: 2008-01-17 13:01:33 -0800 (Thu, 17 Jan 2008)
Log Message:
-----------
Count only DISTINCT names in the portfiles table. This changes nothing, really, since the name is a unique key,
but it does help me, though, make the ports_count() and categories_count() functions look even more similar
(identical by no, I think, with the exception of ports Vs. categories).
Modified Paths:
--------------
trunk/www/includes/common.inc
Modified: trunk/www/includes/common.inc
===================================================================
--- trunk/www/includes/common.inc 2008-01-17 20:57:26 UTC (rev 33094)
+++ trunk/www/includes/common.inc 2008-01-17 21:01:33 UTC (rev 33095)
@@ -110,7 +110,7 @@
function ports_count() {
global $portsdb_name;
- $result = mysql_query("SELECT COUNT(name) FROM $portsdb_name.portfiles") or die("Error: " . mysql_error());
+ $result = mysql_query("SELECT COUNT(DISTINCT name) FROM $portsdb_name.portfiles") or die("Error: " . mysql_error());
if ($result) {
$row = mysql_fetch_array($result);
$count = $row[0];
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080117/f9932076/attachment.html
More information about the macports-changes
mailing list