RE:UPDATE DESDE OTRA TABLA
Publicado por
mary (1 intervención) el 19/02/2010 16:22:54
hola porfa necesito q me ayuden , necesito actualizar los campos de una tabla para a partir de otra, pero el campo con el que quiero actuallizar no aparece en ambas tablas. este es mi codigo.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin título</title>
</head>
<body>
<?php
session_start();
if(!isset($_SESSION['nivel']))
{
//header("Location: login.php");
//return 0;
}
$dsn="x";
$usuario="x";
$clave="x";
$conect=odbc_connect($dsn,$usuario,$clave);
$existe = 0;
if (!$conect){
exit("<strong>)Error al conectarse con la base de datos</strong>");
}
if (isset($_POST['Registrar'])) {
$sector = $_POST["sector"];
$MemoDespacho_not = $_POST["numero_memo"];
$FechaIngreso= $_POST["fecha_exportacion"];
$FechaRecepcion_Notif= $_POST["fecha_recep"];
$sector = $_POST['psector'];
$numero = $_POST['numero_memo'];
$exportacion = $_POST['fecha_exportacion'];
$sql="Update Liqui inner join PLiqui on (Liqui.Rif=PLiqui.Rif) and (Liqui.Secuencial=PLiqui.Secuencial) and (Liqui.FechaLiquidacion=PLiquidacion.FechaLiquidacion) SET (PLiqui.FechaRecep_Noti=date(),PLiqui.fecha_proceso=date(), PLiqui.xx=3) where ((PLiqui.Situacion_Liquidacion=4) and (PLiqui.sect=$sect and (Liqui.MemoDes_not=$numero) and (PLiqui.FechaIngreso='$exportacion'))";
$result=odbc_exec($conect,$sql);
$sql="Update Liqui SET PLiqui.MontoCifras=PLiqui.Montodiv,PLiqui.Multa=PLiqui.Montodiv where ((PLiqui.FechaRecep_Not=date()) and (PLiqui.Situacion_Liquidacion=4 and (PLiqui.Concurrente=1) and (PLiqui.sector=sector))";
$result=odbc_exec($conect,$sql);
}
?>
quiero actualizar los campos fecharecepcion_notif, fechaproceso,txrx pèro no se como hacerlo porfaayudenme , gracias!!
</body>
</html>