Ver Mensaje Individual
  #19 (permalink)  
Antiguo 18/07/2008, 12:56
captainfercho
 
Fecha de Ingreso: julio-2008
Mensajes: 92
Antigüedad: 16 años, 8 meses
Puntos: 0
Respuesta: update con select

observen hago esto:

if($sqlv = "SELECT *FROM jos_df_contact where Notas IS NULL")
{
$sql = "UPDATE jos_df_contact set Notas='".$nota."' where Id=".$correos."";
mysql_query($sql) or die(mysql_error());
}
else{
if($sqlv = "SELECT *FROM jos_df_contact where Notas IS NOT NULL"){
//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')\"/>";
}
}

pero solo funciona el if, no se porque nunca captura el else