Le paso el fragmento de código del formulario de Update:
Código PHP:
Ver original
<form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1"> <input name="fecha_inicio" id="fecha_inicio" type="checkbox" value="Inicio" /> <input name="fecha_fin" id="fecha_fin" type="checkbox" value="Inicio" /> <input type="image" src="../assets/img/btn_guardar_gestionar.jpg" /> <input type="hidden" name="MM_update" value="form1" /> <input type="hidden" name="id" value="<?php echo $row_rs_detalle['id']; ?>" /> </form>
El fragmento de código del Update:
Código PHP:
Ver original
GetSQLValueString($_POST['fecha_inicio'], "text"), GetSQLValueString($_POST['fecha_fin'], "text"), GetSQLValueString($_POST['id'], "int"));
Y el código completo por las dudas:
Código PHP:
Ver original
<?php require_once('../assets/Connections/cnx_m.php'); ?> <?php function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": break; case "double": break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $editFormAction = $_SERVER['PHP_SELF']; } GetSQLValueString($_POST['fecha_inicio'], "text"), GetSQLValueString($_POST['fecha_fin'], "text"), GetSQLValueString($_POST['id'], "int")); $updateGoTo = "ok.php"; $updateGoTo .= $_SERVER['QUERY_STRING']; } } $colname_rs_detalle = "-1"; $colname_rs_detalle = $_GET['id']; } $query_rs_detalle = sprintf("SELECT * FROM presupuestos WHERE id = %s", GetSQLValueString($colname_rs_detalle, "int")); ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title></title> </head> <body> <form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1"> <input name="fecha_inicio" id="fecha_inicio" type="checkbox" value="Inicio" /> <input name="fecha_fin" id="fecha_fin" type="checkbox" value="Inicio" /> <input type="image" src="../assets/img/btn_guardar_gestionar.jpg" /> <input type="hidden" name="MM_update" value="form1" /> <input type="hidden" name="id" value="<?php echo $row_rs_detalle['id']; ?>" /> </form> </body> </html> <?php ?>
Me podrán orientar como debo plantearlo?
Muchas gracias!