Ver Mensaje Individual
  #2 (permalink)  
Antiguo 07/11/2003, 18:46
Avatar de nuevo
nuevo
 
Fecha de Ingreso: mayo-2003
Ubicación: Spain
Mensajes: 2.009
Antigüedad: 20 años, 11 meses
Puntos: 2
yo antes de nada usaria swith antes que IF,,, el uso no es de comparacion si no de ejecucion...

Código PHP:

switch ($var){

case 
'dato1':

break;


case 
'dato2':

break;


default: 

break;

}
//salgo del swhtch 
..............

Código PHP:
<?php
switch ($row["id_tipo"]){

    case 
'1':
        
$certamen=$certamen+1;
        
$cc 1;
            if(
$certamen>$maximo)
                
$maximo $certamen;
            }
    break;

    case 
'2':
        
$test $test+1;
        
$tt 1;
            if(
$test>$maximo)
                
$maximo $test;
            }
    break;

    case 
'3':
        
$cuestionario $cuestionario+1;
        
$cues 1;
            if(
$cuestionario>$maximo)
                
$maximo $cuestionario;
            }
    break;

    case 
'4':
        
$disertacion $disertacion+1;
        
$diser 1;
             if(
$disertacion>$maximo)
                
$maximo $disertacion;
            }
    break;

    case 
'5':
        
$proyecto $proyecto+1;
        
$proy 1;
            if(
$proyecto>$maximo)
                 
$maximo $proyecto;
            }
    break;

    case 
'6':
        
$tarea $tarea+1;
        
$tar 1;
            if(
$tarea>$maximo)
                
$maximo $tarea;
            }
    break;

    case 
'7':
        
$investigacion $investigacion+1;
        
$inv 1;
            if(
$investigacion>$maximo)
                
$maximo $investigacion;
            }
    break;

}
?>
__________________
3w.valenciadjs.com
3w.laislatv.com

Última edición por nuevo; 07/11/2003 a las 18:56