Tema: Validacion
Ver Mensaje Individual
  #7 (permalink)  
Antiguo 19/07/2008, 10:44
captainfercho
 
Fecha de Ingreso: julio-2008
Mensajes: 92
Antigüedad: 16 años, 8 meses
Puntos: 0
Respuesta: Validacion

miren hago esto:

$sqlv = "SELECT CHARACTER_LENGTH(Notas) FROM jos_df_contact WHERE Id=".$correos."";
$resultado = mysql_query($sqlv,$conx) or die(mysql_error());
if($resultado<=0)
{
$sql = "UPDATE jos_df_contact set Notas='".$nota."' where Id=".$correos."";
mysql_query($sql) or die(mysql_error());
echo "Muaaaaaaa\n";
echo "<input type=\"button\" name=\"volver\" title=Volver value=\"\" style=\"background-image:url(iconos/icono_flecha_volver.PNG); width:48px; height:48px; border-bottom-style:none; border-left-style:none; border-right-style:none; border-top-style:none; cursor:pointer; background-color:#FFFFFF \" onClick=\"javascript:IrPagina('http://localhost/combo/pdf/MostrarActualizacion.php')\"/>";

}
elseif($resultado>0){
//Nos traemos el registro del campo notas del id actual para evitar una sobreescritura de datos
$sqla = "SELECT Notas FROM jos_df_contact where Id=".$correos."";
$result = mysql_query($sqla,$conx) or die(mysql_error());//ejecuto select
while($row=mysql_fetch_array($result))
{
$var1= $row['Notas'];
}
$sql = "UPDATE jos_df_contact set Notas='".$var1." ".$nota."' where Id= ".$correos."";
mysql_query($sql) or die(mysql_error());//ejecuto update
echo "Actualizacion Exitosa\n";
echo "<input type=\"button\" name=\"volver\" title=Volver value=\"\" style=\"background-image:url(iconos/icono_flecha_volver.PNG); width:48px; height:48px; border-bottom-style:none; border-left-style:none; border-right-style:none; border-top-style:none; cursor:pointer; background-color:#FFFFFF \" onClick=\"javascript:IrPagina('http://localhost/combo/pdf/MostrarActualizacion.php')\"/>";

}

el punto es que solo siempre coge el else if ayudenme.. ya que soy novato en el asunto

gracias