Ver Mensaje Individual
  #7 (permalink)  
Antiguo 24/10/2008, 09:37
Chelo1982
 
Fecha de Ingreso: agosto-2008
Mensajes: 97
Antigüedad: 15 años, 8 meses
Puntos: 1
Respuesta: Problema con unas variables

este es mi codigo de la segunda pagina

<?php require_once('Connections/connAudit.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
$updateSQL = sprintf("UPDATE tbl_planillabase2 SET CFA=%s, Comments=%s, AccionSorter=%s WHERE id=%s",
GetSQLValueString($_POST['CFA'], "text"),
GetSQLValueString($_POST['Comments'], "text"),
GetSQLValueString($_POST['AccionSorter'], "text"),
GetSQLValueString($_POST['id'], "int"));

mysql_select_db($database_connAudit, $connAudit);
$Result1 = mysql_query($updateSQL, $connAudit) or die(mysql_error());

$updateGoTo = "main.php";
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $updateGoTo));
}

mysql_select_db($database_connAudit, $connAudit);
$query_rs_actualizar = "SELECT id, CFA, AccionSorter, Comments FROM tbl_planillabase2 ";
$rs_actualizar = mysql_query($query_rs_actualizar, $connAudit) or die(mysql_error());
$row_rs_actualizar = mysql_fetch_assoc($rs_actualizar);
$totalRows_rs_actualizar = mysql_num_rows($rs_actualizar);
?>