Disculpa juaniquillo tengo una nueva duda es que ahora quiero actualizar ese dato pero cuadno le doy en el boton de actualizar el cual me lleva a esta pagina
Código PHP:
Ver original<?php require_once('Connections/actualizar.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
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 actualizacion_datos SET nombre=%s, sexo=%s, direccion=%s, barrio=%s, tel_residencia=%s, tel_celular=%s, correo=%s, dia=%s, mes=%s, año=%s, estado_civil=%s, mascota=%s, tipo_mascota=%s, carro=%s, marca_carro=%s, moto=%s, marca_moto=%s, ocupacion=%s, lug_de_trabajo=%s, tel_trabajo=%s, nombre_pareja=%s, dia_pareja=%s, mes_pareja=%s, año_pareja=%s, num_perso_vive=%s, num_hijos=%s, nombre_hijo1=%s, dia_hijo1=%s, mes_hijo1=%s, año_hijo1=%s, nombre_hijo2=%s, dia_hijo2=%s, mes_hijo2=%s, año_hijo2=%s WHERE cedula=%s", GetSQLValueString($_POST['nombre'], "text"),
GetSQLValueString($_POST['sexo'], "text"),
GetSQLValueString($_POST['direccion'], "text"),
GetSQLValueString($_POST['barrio'], "text"),
GetSQLValueString($_POST['tel_residencia'], "int"),
GetSQLValueString($_POST['tel_celular'], "int"),
GetSQLValueString($_POST['correo'], "text"),
GetSQLValueString($_POST['dia'], "int"),
GetSQLValueString($_POST['mes'], "int"),
GetSQLValueString($_POST['ao'], "int"),
GetSQLValueString($_POST['estado_civil'], "text"),
GetSQLValueString($_POST['mascota'], "text"),
GetSQLValueString($_POST['tipo_mascota'], "text"),
GetSQLValueString($_POST['carro'], "text"),
GetSQLValueString($_POST['marca_carro'], "text"),
GetSQLValueString($_POST['moto'], "text"),
GetSQLValueString($_POST['marca_moto'], "text"),
GetSQLValueString($_POST['ocupacion'], "text"),
GetSQLValueString($_POST['lug_de_trabajo'], "text"),
GetSQLValueString($_POST['tel_trabajo'], "int"),
GetSQLValueString($_POST['nombre_pareja'], "text"),
GetSQLValueString($_POST['dia_pareja'], "int"),
GetSQLValueString($_POST['mes_pareja'], "int"),
GetSQLValueString($_POST['ao_pareja'], "int"),
GetSQLValueString($_POST['num_perso_vive'], "int"),
GetSQLValueString($_POST['num_hijos'], "int"),
GetSQLValueString($_POST['nombre_hijo1'], "text"),
GetSQLValueString($_POST['dia_hijo1'], "int"),
GetSQLValueString($_POST['mes_hijo1'], "int"),
GetSQLValueString($_POST['ao_hijo1'], "int"),
GetSQLValueString($_POST['nombre_hijo2'], "text"),
GetSQLValueString($_POST['dia_hijo2'], "int"),
GetSQLValueString($_POST['mes_hijo2'], "int"),
GetSQLValueString($_POST['ao_hijo2'], "int"),
GetSQLValueString($_POST['cedula'], "int"));
$updateGoTo = "tarjetapuntos.php";
if (isset($_SERVER['QUERY_STRING'])) { $updateGoTo .= (strpos($updateGoTo, '?')) ?
"&" : "?"; $updateGoTo .= $_SERVER['QUERY_STRING'];
}
}
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) { $updateSQL = sprintf("UPDATE primera SET nombre=%s, sexo=%s, direccion=%s, barrio=%s, tel_residencia=%s, tel_celular=%s, correo=%s, fecha=%s, estado_civil=%s, mascota=%s, tipo_mascota=%s, carro=%s, marca_carro=%s, moto=%s, marca_moto=%s, ocupacion=%s, lug_de_trabajo=%s, tel_trabajo=%s, nombre_pareja=%s, fecha_pareja=%s, num_perso_vive=%s, num_hijos=%s, nombre_hijo1=%s, fecha_hijo1=%s, nombre_hijo2=%s, fecha_hijo2=%s WHERE cedula=%s", GetSQLValueString($_POST['nombre'], "text"),
GetSQLValueString($_POST['sexo'], "text"),
GetSQLValueString($_POST['direccion'], "text"),
GetSQLValueString($_POST['barrio'], "text"),
GetSQLValueString($_POST['tel_residencia'], "text"),
GetSQLValueString($_POST['tel_celular'], "text"),
GetSQLValueString($_POST['correo'], "text"),
GetSQLValueString($_POST['fecha'], "date"),
GetSQLValueString($_POST['estado_civil'], "text"),
GetSQLValueString($_POST['mascota'], "text"),
GetSQLValueString($_POST['tipo_mascota'], "text"),
GetSQLValueString($_POST['carro'], "text"),
GetSQLValueString($_POST['marca_carro'], "text"),
GetSQLValueString($_POST['moto'], "text"),
GetSQLValueString($_POST['marca_moto'], "text"),
GetSQLValueString($_POST['ocupacion'], "text"),
GetSQLValueString($_POST['lug_de_trabajo'], "text"),
GetSQLValueString($_POST['tel_trabajo'], "int"),
GetSQLValueString($_POST['nombre_pareja'], "text"),
GetSQLValueString($_POST['fecha_pareja'], "date"),
GetSQLValueString($_POST['num_perso_vive'], "int"),
GetSQLValueString($_POST['num_hijos'], "int"),
GetSQLValueString($_POST['nombre_hijo1'], "text"),
GetSQLValueString($_POST['fecha_hijo1'], "date"),
GetSQLValueString($_POST['nombre_hijo2'], "text"),
GetSQLValueString($_POST['fecha_hijo2'], "date"),
GetSQLValueString($_POST['cedula'], "text"));
$updateGoTo = "tarjetapuntos.php";
if (isset($_SERVER['QUERY_STRING'])) { $updateGoTo .= (strpos($updateGoTo, '?')) ?
"&" : "?"; $updateGoTo .= $_SERVER['QUERY_STRING'];
}
}
$query_actualizar1 = "SELECT nombre, sexo, cedula, direccion, barrio, tel_residencia, tel_celular, correo, fecha, estado_civil, mascota, tipo_mascota, carro, marca_carro, moto, marca_moto, ocupacion, lug_de_trabajo, tel_trabajo, nombre_pareja, fecha_pareja, num_perso_vive, num_hijos, nombre_hijo1, fecha_hijo1, nombre_hijo2, fecha_hijo2 FROM primera ";
?><!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>
<style type="text/css">
<!--
body {
background-image: url(fondo%201.png);
}
#Layer1 {
position:absolute;
width:102px;
height:27px;
z-index:1;
left: 821px;
top: 23px;
}
#Layer2 {
position:absolute;
width:588px;
height:755px;
z-index:2;
top: 18px;
left: -1px;
}
.Estilo1 {color: #FF9933}
.Estilo2 {color: #FF0000}
-->
</style></head>
<body>
<div id="Layer1">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="23">
<param name="movie" value="atrasdatos.swf" />
<param name="quality" value="high" />
<param name="BGCOLOR" value="#C8DE9E" />
<embed src="atrasdatos.swf" width="100" height="23" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" bgcolor="#C8DE9E" ></embed>
</object>
</div>
<p> </p>
<p> </p>
<p> </p>
<p> </p>