Tema: Maldito if
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/10/2010, 16:59
Avatar de SirDuque
SirDuque
 
Fecha de Ingreso: febrero-2009
Ubicación: Paso del Rey, Buenos Aires, Argentina
Mensajes: 975
Antigüedad: 15 años, 2 meses
Puntos: 89
Maldito if

Hola gente, tengo un if bastante denso.
Código PHP:
Ver original
  1. if ( ($socio!=NULL and $socio==$row['CODIGO'])and ($apyno!=NULL and $apyno!=$row['APYNO']) and ($direc!=NULL and $direc==$row['DIREC']) and ($postal!=NULL and $postal==$row['CODPOS']) and ($local!=NULL and $local==$row['LOCAL']) and ($telef!=NULL and $telef==$row['TELEF']) and ($estado!=NULL or $estado==$row['ESTADO']) or ($fenac!=NULL and $fenac==$row['FENAC']) and ($fein!=NULL and $fein==$row['FEING']) or ($feegr!=NULL and $feegr==$row['FEEGR']) or ($catego!=NULL and $catego==$row['CATEGO']) and ($nrdoc!=NULL and $nrdoc==$row['NRDOC']) and ($legajo!=NULL and $legajo==$row['LEGAJO']) or ($email!=NULL and $email==$row['EMIAL']) or ($inter!=NULL and $inter==$row['TELELAB']) and ($cremax!=NULL and $cremax==$row['CREMAX']) and ($id!=NULL and $id==$row['ID_SOPRO']))
  2.     {
  3.         echo "se actualizo el Apellido y Nombre<br>";
  4.     }
y este
Código PHP:
Ver original
  1. if ( ($socio!=NULL and $socio==$row['CODIGO'])and ($apyno!=NULL and $apyno==$row['APYNO']) and ($direc!=NULL and $direc!=$row['DIREC']) and ($postal!=NULL and $postal==$row['CODPOS']) and ($local!=NULL and $local==$row['LOCAL']) and ($telef!=NULL and $telef==$row['TELEF']) and ($estado!=NULL or $estado==$row['ESTADO']) or ($fenac!=NULL and $fenac==$row['FENAC']) and ($fein!=NULL and $fein==$row['FEING']) or ($feegr!=NULL and $feegr==$row['FEEGR']) or ($catego!=NULL and $catego==$row['CATEGO']) and ($nrdoc!=NULL and $nrdoc==$row['NRDOC']) and ($legajo!=NULL and $legajo==$row['LEGAJO']) or ($email!=NULL and $email==$row['EMIAL']) or ($inter!=NULL and $inter==$row['TELELAB']) and ($cremax!=NULL and $cremax==$row['CREMAX']) and ($id!=NULL and $id==$row['ID_SOPRO']))
  2.     {
  3.         echo "Cambia direccion<br>";
  4.     }

Si le prestan atencion las diferencias son:


($apyno!=NULL and $apyno!=$row['APYNO']) and ($direc!=NULL and $direc==$row['DIREC'])

($apyno!=NULL and $apyno==$row['APYNO']) and ($direc!=NULL and $direc!=$row['DIREC'])

Para las dos imprimen.
resultado:

echo "se actualizo el Apellido y Nombre<br>";
echo "Cambia direccion<br>";


Alguna idea?