Well, not so sure if this is what you want, but the easy thing is to create the SQL as a variable, then execute it.
$sql = "SELECT var1, var2, var3, var4
FROM table
WHERE this = 'that'";
switch($selected) {
case "var2":
$sql .= "AND var2 = '".$selected."'";
break;
case "var3":
$sql .= "AND var3 = '".$selected."'";
break;
case "var4":
$sql .= "AND var4 = '".$selected."'";
break;
default:
$sql .= "AND var1 = '".$selected."'";
break;
}
$results = mysql_query($sql);