static function embedParams($string, $params, DABLPDO $conn = null) {
		if (null != $conn) {
			$params = $conn->prepareInput($params);
		} else {
			foreach($params as &$value) {
				if (is_int($value)) {
					continue;
				} elseif (is_bool($value)) {
					$value = $value ? 1 : 0;
				} elseif (is_null($value)) {
					$value = 'NULL';
				} else {
					$value = "'{$value}'";
				}
			}
		}

		// escape % by making it %%
		$string = str_replace('%', '%%', $string);

		// replace ? with %s
		$string = str_replace(self::PARAM, '%s', $string);

		// add $query to the beginning of the array
		array_unshift($params, $string);

		if (!($string = @call_user_func_array('sprintf', $params))) {
			throw new RuntimeException('Could not insert parameters into query string. The number of ?s might not match the number of parameters.');
		}
		return $string;
	}
static function embedParams($string, $params, DABLPDO $conn = null) {
		if (null != $conn) {
			$params = $conn->prepareInput($params);
		} else {
			foreach($params as &$value) {
				if (is_int($value)) {
					continue;
				} elseif (is_bool($value)) {
					$value = $value ? 1 : 0;
				} elseif (is_null($value)) {
					$value = 'NULL';
				} else {
					$value = "'{$value}'";
				}
			}
		}

		// escape % by making it %%
		$string = str_replace('%', '%%', $string);

		// replace ? with %s
		$string = str_replace(self::PARAM, '%s', $string);

		// add $query to the beginning of the array
		array_unshift($params, $string);

		if (!($string = @call_user_func_array('sprintf', $params))) {
			throw new RuntimeException('Could not insert parameters into query string. The number of ?s might not match the number of parameters.');
		}
		return $string;
	}
static function embedParams ( $ string , $ params , DABLPDO $ conn = null ) { if ( null != $ conn ) { $ params = $ conn -> prepareInput ( $ params ) ; } else { foreach ( $ params as & $ value ) { if ( is_int ( $ value ) ) { continue ; } elseif ( is_bool ( $ value ) ) { $ value = $ value ? 1 : 0 ; } elseif ( is_null ( $ value ) ) { $ value = 'NULL' ; } else { $ value = "'{$value}'" ; } } } // escape % by making it %% $ string = str_replace ( '%' , '%%' , $ string ) ; // replace ? with %s $ string = str_replace ( self :: PARAM , '%s' , $ string ) ; // add $query to the beginning of the array array_unshift ( $ params , $ string ) ; if ( ! ( $ string = @ call_user_func_array ( 'sprintf' , $ params ) ) ) { throw new RuntimeException ( 'Could not insert parameters into query string. The number of ?s might not match the number of parameters.' ) ; } return $ string ; }
Emulates a prepared statement.  Should only be used as a last resort.
@param string $string
@param array $params
@param DABLPDO $conn
@return string
Emulates a prepared statement . Should only be used as a last resort .