[Mapbender-commits] r4648 - branches/2.6/lib trunk/mapbender/lib

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Sep 17 10:31:46 EDT 2009


Author: verenadiewald
Date: 2009-09-17 10:31:46 -0400 (Thu, 17 Sep 2009)
New Revision: 4648

Modified:
   branches/2.6/lib/database-mysql.php
   branches/2.6/lib/database-mysqli.php
   trunk/mapbender/lib/database-mysql.php
   trunk/mapbender/lib/database-mysqli.php
Log:
http://trac.osgeo.org/mapbender/ticket/502

Modified: branches/2.6/lib/database-mysql.php
===================================================================
--- branches/2.6/lib/database-mysql.php	2009-09-17 14:26:06 UTC (rev 4647)
+++ branches/2.6/lib/database-mysql.php	2009-09-17 14:31:46 UTC (rev 4648)
@@ -174,6 +174,7 @@
  *  @param		$types (array string types)		
  */
 function db_prep_query($qstring, $params, $types){
+	$orig_qstring = $qstring;
 	$ci = new checkInput($qstring,$params,$types);
 	$params = $ci->v; 
 	for ($i=0; $i<count($params); $i++){
@@ -188,6 +189,9 @@
 			$tmp .= "NULL";
 		}
 		$posa = mb_strpos($qstring, $needle);
+		if(!$posa) { 
+ 			$e = new mb_exception("Error while preparing statement in ".$_SERVER['SCRIPT_FILENAME']. ": Sql :". $orig_qstring .",Error: parameter '$needle' not found ");
+ 		}
 		$posb = mb_strlen($needle);
 		$qstring = mb_substr($qstring,0,$posa).$tmp.mb_substr($qstring,($posa + $posb));	
 	}

Modified: branches/2.6/lib/database-mysqli.php
===================================================================
--- branches/2.6/lib/database-mysqli.php	2009-09-17 14:26:06 UTC (rev 4647)
+++ branches/2.6/lib/database-mysqli.php	2009-09-17 14:31:46 UTC (rev 4648)
@@ -147,6 +147,7 @@
  *  @param		$types (array string types)		
  */
 function db_prep_query($qstring, $params, $types){
+	$orig_qstring = $qstring;
 	// Beim Umschreiben an der PostGreSQL-Bibliothek orientieren
 	global $conn, $stmt;
 
@@ -167,6 +168,9 @@
 				$tmp .= "NULL";
 			}
 			$posa = mb_strpos($qstring, $needle);
+			if(!$posa) { 
+ 				$e = new mb_exception("Error while preparing statement in ".$_SERVER['SCRIPT_FILENAME']. ": Sql :". $orig_qstring .",Error: parameter '$needle' not found ");
+ 			}
 			$posb = mb_strlen($needle);
 			$qstring = mb_substr($qstring,0,$posa).$tmp.mb_substr($qstring,($posa + $posb));	
 		}

Modified: trunk/mapbender/lib/database-mysql.php
===================================================================
--- trunk/mapbender/lib/database-mysql.php	2009-09-17 14:26:06 UTC (rev 4647)
+++ trunk/mapbender/lib/database-mysql.php	2009-09-17 14:31:46 UTC (rev 4648)
@@ -174,6 +174,7 @@
  *  @param		$types (array string types)		
  */
 function db_prep_query($qstring, $params, $types){
+	$orig_qstring = $qstring;
 	$ci = new checkInput($qstring,$params,$types);
 	$params = $ci->v; 
 	for ($i=0; $i<count($params); $i++){
@@ -188,6 +189,9 @@
 			$tmp .= "NULL";
 		}
 		$posa = mb_strpos($qstring, $needle);
+		if(!$posa) { 
+ 			$e = new mb_exception("Error while preparing statement in ".$_SERVER['SCRIPT_FILENAME']. ": Sql :". $orig_qstring .",Error: parameter '$needle' not found ");
+ 		}
 		$posb = mb_strlen($needle);
 		$qstring = mb_substr($qstring,0,$posa).$tmp.mb_substr($qstring,($posa + $posb));	
 	}

Modified: trunk/mapbender/lib/database-mysqli.php
===================================================================
--- trunk/mapbender/lib/database-mysqli.php	2009-09-17 14:26:06 UTC (rev 4647)
+++ trunk/mapbender/lib/database-mysqli.php	2009-09-17 14:31:46 UTC (rev 4648)
@@ -147,6 +147,7 @@
  *  @param		$types (array string types)		
  */
 function db_prep_query($qstring, $params, $types){
+	$orig_qstring = $qstring;
 	// Beim Umschreiben an der PostGreSQL-Bibliothek orientieren
 	global $conn, $stmt;
 
@@ -167,6 +168,9 @@
 				$tmp .= "NULL";
 			}
 			$posa = mb_strpos($qstring, $needle);
+			if(!$posa) { 
+ 				$e = new mb_exception("Error while preparing statement in ".$_SERVER['SCRIPT_FILENAME']. ": Sql :". $orig_qstring .",Error: parameter '$needle' not found ");
+ 			}
 			$posb = mb_strlen($needle);
 			$qstring = mb_substr($qstring,0,$posa).$tmp.mb_substr($qstring,($posa + $posb));	
 		}



More information about the Mapbender_commits mailing list