function doquery($id,$type,$subtype,$brand,$make,$proof,$size,$store,$zipcode,$order,$offset,$limit){ $query='SELECT * from drinks '; /*check if there is suppose to be any modification to the query for where statements*/ $filter=''; if(!($id==$type==$subtype==$brand==$make==$size==$proof=='')){ $filter='WHERE '; if($id!='') $filter.="id='".$id."' "; if($type!='') $filter.="type_id='".$type."' "; if($subtype!='') $filter.="subtype_id='".$subtype."' "; if($brand!='') $filter.="brand_id='".$brand."' "; if($make!='') $filter.="make_id='".$make."' "; if($proof!='') $filter.="proof_id='".$proof."' "; if($size!='') $filter.="size_id='".$size."' "; } $result=mysql_query($query.$filter); while($drink=mysql_fetch_assoc($result)){ if(!( } }