Need some help with - Please make sure you properly prepare your data for $wpdb.

#1

Please make sure you properly prepare your data for $wpdb.

Please also read

i will use
can some body help ?
my php file

function of_reset_options($options,$page = ‘’){

global $wpdb;


$query_inner = '';
$count = 0;

$excludes = array( 'blogname' , 'blogdescription' );

foreach($options as $option){
		
	if(isset($option['id'])){ 
		$count++;
		$option_id = $option['id'];
		$option_type = $option['type'];
		
		//Skip assigned id's
		if(in_array($option_id,$excludes)) { continue; }
		
		if($count > 1){ $query_inner .= ' OR '; }
		if($option_type == 'multicheck'){
			$multicount = 0;
			foreach($option['options'] as $option_key => $option_option){
				$multicount++;
				if($multicount > 1){ $query_inner .= ' OR '; }
				$query_inner .= "option_name = '" . $option_id . "_" . $option_key . "'";
				
			}
			
		} else if(is_array($option_type)) {
			$type_array_count = 0;
			foreach($option_type as $inner_option){
				$type_array_count++;
				$option_id = $inner_option['id'];
				if($type_array_count > 1){ $query_inner .= ' OR '; }
				$query_inner .= "option_name = '$option_id'";
			}
			
		} else {
			$query_inner .= "option_name = '$option_id'";
		}
	}
		
}

//When Theme Options page is reset - Add the of_options option
if($page == 'optionsframework'){
	$query_inner .= " OR option_name = 'of_options'";
}

//echo $query_inner;

$query = "DELETE FROM $wpdb->options WHERE $query_inner";
$wpdb->query($query);

}