[Mapbender-commits] r4647 - trunk/mapbender/lib

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Sep 17 10:26:07 EDT 2009


Author: verenadiewald
Date: 2009-09-17 10:26:06 -0400 (Thu, 17 Sep 2009)
New Revision: 4647

Modified:
   trunk/mapbender/lib/database-pgsql.php
Log:
http://trac.osgeo.org/mapbender/ticket/502

Modified: trunk/mapbender/lib/database-pgsql.php
===================================================================
--- trunk/mapbender/lib/database-pgsql.php	2009-09-17 14:23:48 UTC (rev 4646)
+++ trunk/mapbender/lib/database-pgsql.php	2009-09-17 14:26:06 UTC (rev 4647)
@@ -145,6 +145,7 @@
  *  @param		$types (array types as strings)		
  */
 function db_prep_query($qstring, $params, $types){
+	$orig_qstring = $qstring;
 	$ci = new checkInput($qstring,$params,$types);
 	$params = $ci->v; 
 	if(PREPAREDSTATEMENTS == false){
@@ -160,6 +161,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