Better to use a bit of array handling functions to do this.
Untested code ahead, but you should get the idea:
<?php
$query = "select * from table where ";
$fields = array("type","towns","beds");
$count = 0;
foreach ($fields as $f){
if (isset($_GET[$f]) || istrlen($_GET[$f])<>0){
if ($count){
$query.=" OR ";
}
$query.=$f." like '%".$_GET[$f]."%' ";
$count++;
}
print $query;
?>
Like I said, that may be buggy, but you get the idea I hope.
The advantage there is that once you have it working, adding and removing fields involves changing your table and adding entries to a single array.