[35152] trunk/www/ports.php

jmpp at macports.org jmpp at macports.org
Tue Mar 18 09:43:19 PDT 2008


Revision: 35152
          http://trac.macosforge.org/projects/macports/changeset/35152
Author:   jmpp at macports.org
Date:     2008-03-18 09:43:18 -0700 (Tue, 18 Mar 2008)

Log Message:
-----------
Be a bit more explicit on SQL syntax, use the 'AS' clause where appropriate.

Modified Paths:
--------------
    trunk/www/ports.php

Modified: trunk/www/ports.php
===================================================================
--- trunk/www/ports.php	2008-03-18 16:41:34 UTC (rev 35151)
+++ trunk/www/ports.php	2008-03-18 16:43:18 UTC (rev 35152)
@@ -80,27 +80,27 @@
 
     if ($by && ($substr || $by == "all")) {
         $fields = "name, path, version, description";
-        $tables = "$portsdb_name.portfiles p";
+        $tables = "$portsdb_name.portfiles AS p";
         if ($by == "name") {
             $criteria = "p.name LIKE '%" . mysql_real_escape_string($substr) . "%'";
         }
         if ($by == "category") {
-            $tables .= ", $portsdb_name.categories c";
+            $tables .= ", $portsdb_name.categories AS c";
             $criteria = "c.portfile = p.name AND c.category = '" . mysql_real_escape_string($substr) . "'";
         }
         if ($by == "maintainer") {
-            $tables .= ", $portsdb_name.maintainers m";
+            $tables .= ", $portsdb_name.maintainers AS m";
             $criteria = "m.portfile = p.name AND m.maintainer LIKE '%" . mysql_real_escape_string($substr) . "%'";
         }
         if ($by == "library") {
             $criteria = "p.name = '" . mysql_real_escape_string($substr) . "'";
         }
         if ($by == "variant") {
-            $tables .= ", $portsdb_name.variants v";
+            $tables .= ", $portsdb_name.variants AS v";
             $criteria = "v.portfile = p.name AND v.variant = '" . mysql_real_escape_string($substr) . "'";
         }
         if ($by == "platform") {
-            $tables .= ", $portsdb_name.platforms pl";
+            $tables .= ", $portsdb_name.platforms AS pl";
             $criteria = "pl.portfile = p.name AND pl.platform = '" . mysql_real_escape_string($substr) . "'";
         }
         $query = "SELECT DISTINCT $fields FROM $tables WHERE $criteria ORDER BY name";

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080318/5402e442/attachment-0001.html 


More information about the macports-changes mailing list