if($var= "" && $var2= "" && $var3= "" && $var4= "" && $var5= "" && $var6= "") { $select = "Select * from mitabla where 1"; $exec = mysql_query($select) or die(mysql_error()); }