Move the list of fields into an array, thus removing the * field so
authorJoey Schulze <joey@infodrom.org>
Sat, 2 Oct 2004 18:02:05 +0000 (18:02 +0000)
committerJoey Schulze <joey@infodrom.org>
Sat, 2 Oct 2004 18:02:05 +0000 (18:02 +0000)
that name is not duplicate anymore.

src/InfoCon/hwdb/compound.wml

index 4681bd3..2867a37 100644 (file)
@@ -7,9 +7,17 @@
 <dbconnect>
 
   if ($id) {
-    $query = sprintf ("SELECT *,organisation.name as organisation "
+    $fields = array ('compound.name',
+                    'compound.hostname',
+                    'compound.ip',
+                    'compound.ident',
+                    'compound.location',
+                    'compound.status',
+                    'organisation.name as organisation');
+    $query = sprintf ("SELECT %s "
                     ."FROM compound,organisation "
-                    ."WHERE location = organisation.id AND compound.id = %d", $id);
+                    ."WHERE location = organisation.id AND compound.id = %d",
+                    implode (",", $fields), $id);
     $sth = pg_exec ($dbh, $query) or die_query("Cannot issue query!", $query);
 
     if (pg_NumRows ($sth) > 0) {