[Mapbender-commits] r3017 - trunk/mapbender/http/classes

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Sep 26 03:56:14 EDT 2008


Author: verenadiewald
Date: 2008-09-26 03:56:14 -0400 (Fri, 26 Sep 2008)
New Revision: 3017

Modified:
   trunk/mapbender/http/classes/class_wfs_conf.php
Log:
http://trac.osgeo.org/mapbender/ticket/301 -> Sort wfs conf selectbox in order of wfsConfIdString

Modified: trunk/mapbender/http/classes/class_wfs_conf.php
===================================================================
--- trunk/mapbender/http/classes/class_wfs_conf.php	2008-09-26 07:52:43 UTC (rev 3016)
+++ trunk/mapbender/http/classes/class_wfs_conf.php	2008-09-26 07:56:14 UTC (rev 3017)
@@ -93,27 +93,19 @@
 	 * @param $idArray Array an array of integer values representing WFS conf IDs.
 	 */
 	private static function getWfsConfFromDbByArray ($idArray) {
-		$sql = "SELECT * FROM wfs_conf ";
-		$sql .= "JOIN wfs ON wfs_conf.fkey_wfs_id = wfs.wfs_id ";
-		$sql .= "WHERE wfs_conf.wfs_conf_id IN (";
-		
-		$v = array();
-		$t = array();
-		for ($i = 0; $i < count($idArray); $i++) {
-			if ($i > 0) {$sql .= ", ";}
-			$sql .= "$" . ($i+1);
-			array_push($v, $idArray[$i]);
-			array_push($t, 'i');
-		}
-		$sql .= ")";
-		
-		$res = db_prep_query($sql, $v, $t);
-		
 		$rowArray = array();
-		while ($row = db_fetch_array($res)) {
-			array_push($rowArray, $row);
-		}
-		return $rowArray;
+        foreach ($idArray as $id) {
+        		$sql = "SELECT * FROM wfs_conf ";
+                $sql .= "JOIN wfs ON wfs_conf.fkey_wfs_id = wfs.wfs_id ";
+                $sql .= "WHERE wfs_conf.wfs_conf_id = $1 LIMIT 1";
+        
+                $v = array($id);
+                $t = array("i");
+                $res = db_prep_query($sql, $v, $t);
+                $row = db_fetch_array($res);
+                array_push($rowArray, $row);
+        }
+        return $rowArray;
 	}
 	
 	/**



More information about the Mapbender_commits mailing list