[Mapbender-commits] r3016 - branches/2.5/http/classes

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Sep 26 03:52:44 EDT 2008


Author: verenadiewald
Date: 2008-09-26 03:52:43 -0400 (Fri, 26 Sep 2008)
New Revision: 3016

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

Modified: branches/2.5/http/classes/class_wfs_conf.php
===================================================================
--- branches/2.5/http/classes/class_wfs_conf.php	2008-09-26 07:40:36 UTC (rev 3015)
+++ branches/2.5/http/classes/class_wfs_conf.php	2008-09-26 07:52:43 UTC (rev 3016)
@@ -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