You can construct your where condition dynamically, note that this also works if both conditions are empty
$sql = "SELECT something FROM table where 1 ";
if(trim($condition_1) != '')
$sql .= " AND row_1='$condition_1'";
if(trim($condition_2) != '')
$sql .= " AND row_2='$condition_2'";
mysql_query($sql);