Ver Mensaje Individual
  #2 (permalink)  
Antiguo 23/03/2012, 11:54
Avatar de informacionsys
informacionsys
 
Fecha de Ingreso: mayo-2011
Ubicación: Bogota D.C
Mensajes: 793
Antigüedad: 13 años, 8 meses
Puntos: 76
Respuesta: Consulta según checkbox

lo puedes hacer asi :

tu html:

Código HTML:
Ver original
  1. <input type="checkbox" value="1" name="chk[]" id="chk[]">opcion 1
  2. <input type="checkbox" value="2" name="chk[]" id="chk[]">opcion 2
  3. <input type="checkbox" value="3" name="chk[]" id="chk[]">opcion 3
  4. <input type="checkbox" value="4" name="chk[]" id="chk[]">opcion 4


Código PHP:
Ver original
  1. $chk_valores = $_POST["chk"];// te retornara un array
  2. $count = count($chk_valores);
  3.  
  4. for($i = 0 ;$i < $count;$i++){
  5.      $valores = $chk_valores[$i];
  6.     if($valores ==  1){
  7.              $consulta1="completado!='0000-00-00 00:00:00'";
  8.     }        
  9.  
  10.     if($valores ==  2){
  11.             $consulta2="CURDATE()<fecha_fin AND completado LIKE '0000-00-00 00:00:00'";
  12.     }// etc
  13.  
  14. }