if ($dato != 999999)$condicion = " where estado=".$dato;else $condicion = " where estado in (1,2,3) "; // o ensu defecto no coloca condicion