private function escapeQuestionmark($query, $params) {

		preg_match_all('#([\\\]{0,})(\?)#', $query, $variables);

 		if(true === isset($variables[0])) {

 			foreach($variables[0] as $index => $variable) {

 				//Check if ? sign is escaped or not
 				if(strlen($variables[1][$index]) % 2 !== 0) {
 					continue;
 				}

 				if(false === isset($params[$index])) {
 					return trigger_error('Number of variable elements query string does not match number of bind variables');
 				}

 				$var = $params[$index];

 				switch(gettype($var)) {

					case 'string' : $var = '"' . $this -> escape($var) . '"'; break;
					case 'NULL' : $var = 'NULL'; break;
					default : $var = $this -> escape($var); break;
				}
 				
 				$query = preg_replace('#' . preg_quote($variable, '/') . '#', $var, $query, 1);
 			}
 		}

		return $query;
	}
private function escapeQuestionmark($query, $params) {

		preg_match_all('#([\\\]{0,})(\?)#', $query, $variables);

 		if(true === isset($variables[0])) {

 			foreach($variables[0] as $index => $variable) {

 				//Check if ? sign is escaped or not
 				if(strlen($variables[1][$index]) % 2 !== 0) {
 					continue;
 				}

 				if(false === isset($params[$index])) {
 					return trigger_error('Number of variable elements query string does not match number of bind variables');
 				}

 				$var = $params[$index];

 				switch(gettype($var)) {

					case 'string' : $var = '"' . $this -> escape($var) . '"'; break;
					case 'NULL' : $var = 'NULL'; break;
					default : $var = $this -> escape($var); break;
				}
 				
 				$query = preg_replace('#' . preg_quote($variable, '/') . '#', $var, $query, 1);
 			}
 		}

		return $query;
	}
private function escapeQuestionmark ( $ query , $ params ) { preg_match_all ( '#([\\\]{0,})(\?)#' , $ query , $ variables ) ; if ( true === isset ( $ variables [ 0 ] ) ) { foreach ( $ variables [ 0 ] as $ index => $ variable ) { //Check if ? sign is escaped or not
 if ( strlen ( $ variables [ 1 ] [ $ index ] ) % 2 !== 0 ) { continue ; } if ( false === isset ( $ params [ $ index ] ) ) { return trigger_error ( 'Number of variable elements query string does not match number of bind variables' ) ; } $ var = $ params [ $ index ] ; switch ( gettype ( $ var ) ) { case 'string' : $ var = '"' . $ this -> escape ( $ var ) . '"' ; break ; case 'NULL' : $ var = 'NULL' ; break ; default : $ var = $ this -> escape ( $ var ) ; break ; } $ query = preg_replace ( '#' . preg_quote ( $ variable , '/' ) . '#' , $ var , $ query , 1 ) ; } } return $ query ; }
Escape variables bind with a question mark
@param string $query
@param array $params
@return string
Escape variables bind with a question mark