Foros del Web » Creando para Internet » Herramientas y Software »

Ayuda DW y MYSQL

Estas en el tema de Ayuda DW y MYSQL en el foro de Herramientas y Software en Foros del Web. ola lo que quiero es q tngo un pagina q se llama actualizar.php la cual contiene un area de texto y boton de buscar al ...
  #1 (permalink)  
Antiguo 26/05/2010, 10:05
 
Fecha de Ingreso: abril-2010
Mensajes: 50
Antigüedad: 14 años
Puntos: 0
Exclamación Ayuda DW y MYSQL

ola lo que quiero es q tngo un pagina q se llama actualizar.php la cual contiene un area de texto y boton de buscar al introducir el documento el va y busca si estaq en la base de datos quiero q me muestre ese dato antes introducido en la pagina actualizar pero cuadno ago esto el me muestra tda la tabla ahora lo e modificado y me muestra solo el primer dato de esa tabla y lo q quiero es q me muestre el dato antes introducido en el buscador gracias de ante mano espero haber sido lo suficientemente claro gracias y espero q me puedan ayudar
Código PHP:
<?php

$link 
mysql_connect("localhost""root""");

mysql_select_db("supermercado"$link);

$result=mysql_query("SELECT  cedula, nombre FROM primera "$link);

if (
$row mysql_fetch_array($result)){

echo 
"<table border = '1'> ";

echo 
"<tr> ";

echo 
"<td><b>Cedula</b></td> ";

echo 
"<td><b>Nombre</b></td> ";

echo 
"</tr> ";

{

echo 
"<tr> ";

echo 
"<td>".$row["cedula"]."</td> ";

echo 
"<td>".$row["nombre"]."</td>";

echo 
"</tr> ";

} while (
$row mysql_fetch_array($result));


else {

echo 
"¡ La base de datos está vacia !";

}


?>


Mira aca esta la primera pagina actualizar.php y por defecto es el buscador.
Código PHP:
<form id="form1" name="form1" method="post" action="actualizar.php">
  <
label for="textfield"></label>
  <
input type="text" name="cedula" id="cedula" />
  <
label for="Submit"></label>
  <
input type="submit" value="Buscar" />
</
form
luego me lleva a esta pagina donde verifica si esta en la base de datos o no
Código PHP:
<?php
include("conexion.php");
$doc=$_POST["cedula"];
$dt=0;
$consulta=mysql_query ('SELECT* FROM primera');
while (
$fila=mysql_fetch_array($consulta)){  
if (
$fila['cedula'] ==$doc)
$dt=1;
}



if (
$dt==0)
{

echo 
"<strong> <center> no c encuentra en nuestr abase de datos</strong>";
}

else
{

header("location:datos.php?doc=$doc");
}


 
?>
y si el dato antes introducido esta en la base de datos me lleva a esta que es donde me debe mostrar los datos de esa persona
Código PHP:
<?php

$link 
mysql_connect("localhost""root""");

mysql_select_db("supermercado"$link);

$result=mysql_query("SELECT  cedula, nombre FROM primera "$link);

if (
$row mysql_fetch_array($result)){

echo 
"<table border = '1'> ";

echo 
"<tr> ";

echo 
"<td><b>Cedula</b></td> ";

echo 
"<td><b>Nombre</b></td> ";

echo 
"</tr> ";

{

echo 
"<tr> ";

echo 
"<td>".$row["cedula"]."</td> ";

echo 
"<td>".$row["nombre"]."</td>";

echo 
"</tr> ";

} while (
$row mysql_fetch_array($result));


else {

echo 
"¡ La base de datos está vacia !";

}


?>
espero haber sido lo suficienteme claro gfraias de antemano
  #2 (permalink)  
Antiguo 31/05/2010, 13:20
Avatar de juaniquillo
Colaborador
 
Fecha de Ingreso: noviembre-2005
Ubicación: San Juan, Puerto Rico
Mensajes: 5.745
Antigüedad: 18 años, 5 meses
Puntos: 281
Respuesta: Ayuda DW y MYSQL

No entiendo por qué haces todo eso. Creo que lo podrías simplificar en dos páginas. Pero bueno, para resolver el problema solo necesitas especificar en la consulta que el campo de la célula sea igual al valor enviado:

Código PHP:
Ver original
  1. //recibes la variable
  2. $doc = $_GET['doc'];
  3. //especificas que quieres que sea igual al campo que buscas
  4. $result=mysql_query("SELECT  cedula, nombre FROM primera WHERE cedula = '$doc' ", $link);
__________________
Por fin.. tengo algo parecido a un blog
Y por lo visto ya estoy escribiendo...
  #3 (permalink)  
Antiguo 01/06/2010, 06:56
 
Fecha de Ingreso: abril-2010
Mensajes: 50
Antigüedad: 14 años
Puntos: 0
Respuesta: Ayuda DW y MYSQL

Siiiiiii juaniquillo Muchisimas graciassssssss De verdad si que me ah servido tu ayuda muchas gracias dime como te puedo agradecer esta ayuda graciass FOROSDELWEB lo mejor
  #4 (permalink)  
Antiguo 01/06/2010, 07:09
 
Fecha de Ingreso: abril-2010
Mensajes: 50
Antigüedad: 14 años
Puntos: 0
Respuesta: Ayuda DW y MYSQL

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
  1. <?php require_once('Connections/actualizar.php'); ?>
  2. <?php
  3. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  4. {
  5.   $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
  6.  
  7.   switch ($theType) {
  8.     case "text":
  9.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  10.       break;    
  11.     case "long":
  12.     case "int":
  13.       $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  14.       break;
  15.     case "double":
  16.       $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
  17.       break;
  18.     case "date":
  19.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  20.       break;
  21.     case "defined":
  22.       $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  23.       break;
  24.   }
  25.   return $theValue;
  26. }
  27.  
  28. $editFormAction = $_SERVER['PHP_SELF'];
  29. if (isset($_SERVER['QUERY_STRING'])) {
  30.   $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
  31. }
  32.  
  33. if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
  34.   $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",
  35.                        GetSQLValueString($_POST['nombre'], "text"),
  36.                        GetSQLValueString($_POST['sexo'], "text"),
  37.                        GetSQLValueString($_POST['direccion'], "text"),
  38.                        GetSQLValueString($_POST['barrio'], "text"),
  39.                        GetSQLValueString($_POST['tel_residencia'], "int"),
  40.                        GetSQLValueString($_POST['tel_celular'], "int"),
  41.                        GetSQLValueString($_POST['correo'], "text"),
  42.                        GetSQLValueString($_POST['dia'], "int"),
  43.                        GetSQLValueString($_POST['mes'], "int"),
  44.                        GetSQLValueString($_POST['ao'], "int"),
  45.                        GetSQLValueString($_POST['estado_civil'], "text"),
  46.                        GetSQLValueString($_POST['mascota'], "text"),
  47.                        GetSQLValueString($_POST['tipo_mascota'], "text"),
  48.                        GetSQLValueString($_POST['carro'], "text"),
  49.                        GetSQLValueString($_POST['marca_carro'], "text"),
  50.                        GetSQLValueString($_POST['moto'], "text"),
  51.                        GetSQLValueString($_POST['marca_moto'], "text"),
  52.                        GetSQLValueString($_POST['ocupacion'], "text"),
  53.                        GetSQLValueString($_POST['lug_de_trabajo'], "text"),
  54.                        GetSQLValueString($_POST['tel_trabajo'], "int"),
  55.                        GetSQLValueString($_POST['nombre_pareja'], "text"),
  56.                        GetSQLValueString($_POST['dia_pareja'], "int"),
  57.                        GetSQLValueString($_POST['mes_pareja'], "int"),
  58.                        GetSQLValueString($_POST['ao_pareja'], "int"),
  59.                        GetSQLValueString($_POST['num_perso_vive'], "int"),
  60.                        GetSQLValueString($_POST['num_hijos'], "int"),
  61.                        GetSQLValueString($_POST['nombre_hijo1'], "text"),
  62.                        GetSQLValueString($_POST['dia_hijo1'], "int"),
  63.                        GetSQLValueString($_POST['mes_hijo1'], "int"),
  64.                        GetSQLValueString($_POST['ao_hijo1'], "int"),
  65.                        GetSQLValueString($_POST['nombre_hijo2'], "text"),
  66.                        GetSQLValueString($_POST['dia_hijo2'], "int"),
  67.                        GetSQLValueString($_POST['mes_hijo2'], "int"),
  68.                        GetSQLValueString($_POST['ao_hijo2'], "int"),
  69.                        GetSQLValueString($_POST['cedula'], "int"));
  70.  
  71.   mysql_select_db($database_actualizar, $actualizar);
  72.   $Result1 = mysql_query($updateSQL, $actualizar) or die(mysql_error());
  73.  
  74.   $updateGoTo = "tarjetapuntos.php";
  75.   if (isset($_SERVER['QUERY_STRING'])) {
  76.     $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
  77.     $updateGoTo .= $_SERVER['QUERY_STRING'];
  78.   }
  79.   header(sprintf("Location: %s", $updateGoTo));
  80. }
  81.  
  82. if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
  83.   $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",
  84.                        GetSQLValueString($_POST['nombre'], "text"),
  85.                        GetSQLValueString($_POST['sexo'], "text"),
  86.                        GetSQLValueString($_POST['direccion'], "text"),
  87.                        GetSQLValueString($_POST['barrio'], "text"),
  88.                        GetSQLValueString($_POST['tel_residencia'], "text"),
  89.                        GetSQLValueString($_POST['tel_celular'], "text"),
  90.                        GetSQLValueString($_POST['correo'], "text"),
  91.                        GetSQLValueString($_POST['fecha'], "date"),
  92.                        GetSQLValueString($_POST['estado_civil'], "text"),
  93.                        GetSQLValueString($_POST['mascota'], "text"),
  94.                        GetSQLValueString($_POST['tipo_mascota'], "text"),
  95.                        GetSQLValueString($_POST['carro'], "text"),
  96.                        GetSQLValueString($_POST['marca_carro'], "text"),
  97.                        GetSQLValueString($_POST['moto'], "text"),
  98.                        GetSQLValueString($_POST['marca_moto'], "text"),
  99.                        GetSQLValueString($_POST['ocupacion'], "text"),
  100.                        GetSQLValueString($_POST['lug_de_trabajo'], "text"),
  101.                        GetSQLValueString($_POST['tel_trabajo'], "int"),
  102.                        GetSQLValueString($_POST['nombre_pareja'], "text"),
  103.                        GetSQLValueString($_POST['fecha_pareja'], "date"),
  104.                        GetSQLValueString($_POST['num_perso_vive'], "int"),
  105.                        GetSQLValueString($_POST['num_hijos'], "int"),
  106.                        GetSQLValueString($_POST['nombre_hijo1'], "text"),
  107.                        GetSQLValueString($_POST['fecha_hijo1'], "date"),
  108.                        GetSQLValueString($_POST['nombre_hijo2'], "text"),
  109.                        GetSQLValueString($_POST['fecha_hijo2'], "date"),
  110.                        GetSQLValueString($_POST['cedula'], "text"));
  111.  
  112.   mysql_select_db($database_actualizar, $actualizar);
  113.   $Result1 = mysql_query($updateSQL, $actualizar) or die(mysql_error());
  114.  
  115.   $updateGoTo = "tarjetapuntos.php";
  116.   if (isset($_SERVER['QUERY_STRING'])) {
  117.     $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
  118.     $updateGoTo .= $_SERVER['QUERY_STRING'];
  119.   }
  120.   header(sprintf("Location: %s", $updateGoTo));
  121. }
  122.  
  123.  
  124. mysql_select_db($database_actualizar, $actualizar);
  125.  
  126. $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 ";
  127.  
  128.  
  129. $actualizar1 = mysql_query($query_actualizar1, $actualizar) or die(mysql_error());
  130. $row_actualizar1 = mysql_fetch_assoc($actualizar1);
  131. $totalRows_actualizar1 = mysql_num_rows($actualizar1);
  132. ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  133. <html xmlns="http://www.w3.org/1999/xhtml">
  134. <head>
  135. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  136. <title>Documento sin t&iacute;tulo</title>
  137. <style type="text/css">
  138. <!--
  139. body {
  140.     background-image: url(fondo%201.png);
  141. }
  142. #Layer1 {
  143.     position:absolute;
  144.     width:102px;
  145.     height:27px;
  146.     z-index:1;
  147.     left: 821px;
  148.     top: 23px;
  149. }
  150. #Layer2 {
  151.     position:absolute;
  152.     width:588px;
  153.     height:755px;
  154.     z-index:2;
  155.     top: 18px;
  156.     left: -1px;
  157. }
  158. .Estilo1 {color: #FF9933}
  159. .Estilo2 {color: #FF0000}
  160. -->
  161. </style></head>
  162.  
  163. <body>
  164. <div id="Layer1">
  165.   <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">
  166.     <param name="movie" value="atrasdatos.swf" />
  167.     <param name="quality" value="high" />
  168.     <param name="BGCOLOR" value="#C8DE9E" />
  169.     <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>
  170.   </object>
  171. </div>
  172. <p>&nbsp;</p>
  173. <p>&nbsp;</p>
  174. <p>&nbsp;</p>
  175. <p>&nbsp;</p>
disculpa me toca anexar otro msj y ahi continua el codigo
  #5 (permalink)  
Antiguo 01/06/2010, 07:10
 
Fecha de Ingreso: abril-2010
Mensajes: 50
Antigüedad: 14 años
Puntos: 0
Respuesta: Ayuda DW y MYSQL

Código PHP:
Ver original
  1. <div id="Layer2">
  2.   <form action="<?php echo $editFormAction; ?>" method="post" name="actualizar" id="actualizar">
  3.        <table width="938" border="1" align="center" bordercolor="#FFFFFF" bgcolor="">
  4.     <tr valign="baseline">
  5.       <td colspan="3" align="right" nowrap><div align="center" class="Estilo2">DATOS PERSONALES </div></td>
  6.     </tr>
  7.     <tr valign="baseline">
  8.       <td width="325" align="right" nowrap><span class="Estilo1">Nombre:
  9.           <input type="text" name="nombre" value="<?php echo $row_actualizar1['nombre']; ?>" size="32">
  10.       </span></td>
  11.       <td width="276" nowrap="NOWRAP"><span class="Estilo1">Sexo:(M/F)
  12.           <input type="text" name="sexo" value="<?php echo $row_actualizar1['sexo']; ?>" size="2">
  13.       </span></td>
  14.       <td width="315" nowrap="NOWRAP"><span class="Estilo1">Cedula
  15.           <input type="text" name="cedula" value="<?php echo $row_actualizar1['cedula']; ?>" size="15">
  16.       </span></td>
  17.     </tr>
  18.     <tr valign="baseline">
  19.       <td align="right" nowrap><span class="Estilo1">Direccion
  20.           <input type="text" name="direccion" value="<?php echo $row_actualizar1['direccion']; ?>" size="32">
  21.       </span></td>
  22.       <td colspan="2" nowrap="NOWRAP"><div align="left" class="Estilo1">Barrio
  23.           <input type="text" name="barrio" value="<?php echo $row_actualizar1['barrio']; ?>" size="32">
  24.       </div></td>
  25.     </tr>
  26.     <tr valign="baseline">
  27.       <td align="right" nowrap><span class="Estilo1">Telefono Residencia:  
  28.           <input type="text" name="tel_residencia" value="<?php echo $row_actualizar1['tel_residencia']; ?>" size="32">
  29.       </span></td>
  30.       <td nowrap="NOWRAP"><span class="Estilo1">Telefono Celular        
  31.       :      
  32.           <input type="text" name="tel_celular" value="<?php echo $row_actualizar1['tel_celular']; ?>" size="15">
  33.       </span></td>
  34.       <td nowrap="NOWRAP"><span class="Estilo1">Correo:        
  35.           <input type="text" name="correo" value="<?php echo $row_actualizar1['correo']; ?>" size="30">
  36.       </span></td>
  37.     </tr>
  38.     <tr valign="baseline">
  39.       <td align="right" nowrap><p class="Estilo1">No Usar Espacios Ni Caracteres Especiales </p>
  40.         <p class="Estilo1">Fecha Nacimiento (aaaammdd):
  41.       <input type="text" name="fecha" value="<?php echo $row_actualizar1['fecha']; ?>" size="8" /></p></td>
  42.       <td colspan="2" nowrap="NOWRAP"><p class="Estilo1">&nbsp;</p>
  43.         <p class="Estilo1">Estado Civil Actual
  44.           <input type="text" name="estado_civil" value="<?php echo $row_actualizar1['estado_civil']; ?>" size="10">
  45.       </p></td>
  46.     </tr>
  47.     <tr valign="baseline">
  48.       <td height="79" align="right" nowrap><p align="left" class="Estilo1">Mascota (Si/No):
  49.           <input type="text" name="mascota" value="<?php echo $row_actualizar1['mascota']; ?>" size="2">
  50.         </p>
  51.         <p align="left" class="Estilo1">Tipo De Mascota:
  52.           <input type="text" name="tipo_mascota" value="<?php echo $row_actualizar1['tipo_mascota']; ?>" size="25">
  53.       </p></td>
  54.       <td nowrap="NOWRAP"><p class="Estilo1">Carro (Si/No):
  55.           <input type="text" name="carro" value="<?php echo $row_actualizar1['carro']; ?>" size="2">
  56.       </p>
  57.         <p class="Estilo1">Modelo Carro :
  58.           <input type="text" name="marca_carro" value="<?php echo $row_actualizar1['marca_carro']; ?>" size="20">
  59.       </p></td>
  60.       <td nowrap="NOWRAP"><p class="Estilo1">Moto (Si/No):
  61.           <input type="text" name="moto" value="<?php echo $row_actualizar1['moto']; ?>" size="2">
  62.       </p>
  63.         <p class="Estilo1">Modelo Moto:
  64.           <input type="text" name="marca_moto" value="<?php echo $row_actualizar1['marca_moto']; ?>" size="25">
  65.       </p></td>
  66.     </tr>
  67.     <tr valign="baseline">
  68.       <td colspan="3" align="right" nowrap><div align="center" class="Estilo2 Estilo1">INFORMACION LABORAL </div></td>
  69.     </tr>
  70.     <tr valign="baseline">
  71.       <td align="right" nowrap><span class="Estilo1">Ocupacion:
  72.           <input type="text" name="ocupacion" value="<?php echo $row_actualizar1['ocupacion']; ?>" size="32">
  73.       </span></td>
  74.       <td nowrap="NOWRAP"><span class="Estilo1">Empresa :
  75.           <input type="text" name="lug_de_trabajo" value="<?php echo $row_actualizar1['lug_de_trabajo']; ?>" size="25">
  76.       </span></td>
  77.       <td nowrap="NOWRAP"><span class="Estilo1">Telefono:
  78.           <input type="text" name="tel_trabajo" value="<?php echo $row_actualizar1['tel_trabajo']; ?>" size="10">
  79.       </span></td>
  80.     </tr>
  81.     <tr valign="baseline">
  82.       <td colspan="3" align="right" nowrap><div align="center" class="Estilo2 Estilo1">INFORMACION FAMILIAR </div></td>
  83.     </tr>
  84.     <tr valign="baseline">
  85.       <td align="right" nowrap><p class="Estilo1">&nbsp;</p>
  86.         <p class="Estilo1">Nom_Pareja:
  87.           <input type="text" name="nombre_pareja" value="<?php echo $row_actualizar1['nombre_pareja']; ?>" size="20">
  88.       </p>      </td>
  89.       <td nowrap="NOWRAP"><p class="Estilo1">No Usar Espacios Ni Caracteres Especiales</p>
  90.         <p align="center" class="Estilo1">Fecha Nacimiento (aaaammdd):
  91.           <input type="text" name="fecha_pareja" value="<?php echo $row_actualizar1['fecha_pareja']; ?>" size="8">
  92.         </p></td>
  93.       <td nowrap="NOWRAP"><p class="Estilo1">N&ordm; Personas en su Vivienda:
  94.         <input type="text" name="num_perso_vive" value="<?php echo $row_actualizar1['num_perso_vive']; ?>" size="2">
  95.       </p>
  96.       <p class="Estilo1">N&ordm; de Hijos:
  97.         <input type="text" name="num_hijos" value="<?php echo $row_actualizar1['num_hijos']; ?>" size="2">
  98. </p></td>
  99.     </tr>
  100.     <tr valign="baseline">
  101.       <td colspan="3" align="right" nowrap><div align="center" class="Estilo2 Estilo1">Nombre Completo Hijos</div></td>
  102.     </tr>
  103.     <tr valign="baseline">
  104.       <td colspan="3" align="right" nowrap><div align="center" class="Estilo1">
  105.         <input type="text" name="nombre_hijo1" value="<?php echo $row_actualizar1['nombre_hijo1']; ?>" size="32">
  106.       </div></td>
  107.     </tr>
  108.     <tr valign="baseline">
  109.       <td colspan="3" align="right" nowrap>      <div align="center" class="Estilo1">
  110.         <input type="text" name="nombre_hijo2" value="<?php echo $row_actualizar1['nombre_hijo2']; ?>" size="32">
  111.       </div></td>
  112.     </tr>
  113.     <tr valign="baseline">
  114.       <td colspan="3" align="right" nowrap>      <div align="center" class="Estilo1">
  115.         <p>No Usar Espacios Ni Caracteres Especiales</p>
  116.         <p>Fecha Nacimiento Hijos (aaaammdd) </p>
  117.       </div></td>
  118.     </tr>
  119.     <tr valign="baseline">
  120.       <td colspan="3" align="right" nowrap>      <div align="center" class="Estilo1">
  121.         <input type="text" name="fecha_hijo1" value="<?php echo $row_actualizar1['fecha_hijo1']; ?>" size="8">
  122.       </div></td>
  123.     </tr>
  124.     <tr valign="baseline">
  125.       <td colspan="3" align="right" nowrap>      <div align="center" class="Estilo1">
  126.         <input type="text" name="fecha_hijo2" value="<?php echo $row_actualizar1['fecha_hijo2']; ?>" size="8">
  127.       </div></td>
  128.     </tr>
  129.     <tr valign="baseline">
  130.       <td colspan="3" align="right" nowrap><div align="center" class="Estilo1">
  131.         <input type="submit" value="Actualizar Registro">
  132.       </div></td>
  133.     </tr>
  134.   </table>
  135.  
  136.    
  137.           <td>&nbsp;</td>
  138.           </tr>
  139.       </table>
  140.       <input type="hidden" name="MM_update" value="form1">
  141.       <input type="hidden" name="cedula" value="<?php echo $row_actualizar1['cedula'];
  142.  
  143.       ?>">
  144.     </form>
  145.     <p>&nbsp;</p>
  146.     <p>&nbsp;</p>
  147. </div>
  148. <p>&nbsp;</p>
  149. </body>
  150. </html>
  151. <?php
  152. mysql_free_result($actualizar1);
  153. ?>
pero el problema es que me muestra el primer dato de la tabla de la bd y quiero actualizar el dato antes introducido en el buscador gracias espero me hallas entendido gracias
  #6 (permalink)  
Antiguo 01/06/2010, 18:19
Avatar de juaniquillo
Colaborador
 
Fecha de Ingreso: noviembre-2005
Ubicación: San Juan, Puerto Rico
Mensajes: 5.745
Antigüedad: 18 años, 5 meses
Puntos: 281
Respuesta: Ayuda DW y MYSQL

No entendí tu duda Diego. ¿qué pasa? ¿no está haciendo el update?
__________________
Por fin.. tengo algo parecido a un blog
Y por lo visto ya estoy escribiendo...
  #7 (permalink)  
Antiguo 01/06/2010, 18:25
Avatar de juaniquillo
Colaborador
 
Fecha de Ingreso: noviembre-2005
Ubicación: San Juan, Puerto Rico
Mensajes: 5.745
Antigüedad: 18 años, 5 meses
Puntos: 281
Respuesta: Ayuda DW y MYSQL

Ahora vi que tienes dos updates en y estás usando un mismo formulario. NO estoy seguro de lo quieres hacer. Igual, donde dice:

Código PHP:
Ver original
  1. $updateGoTo = "tarjetapuntos.php";
  2. if (isset($_SERVER['QUERY_STRING'])) {
  3.     $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
  4.     $updateGoTo .= $_SERVER['QUERY_STRING'];
  5. }
  6. header(sprintf("Location: %s", $updateGoTo));

es lo que hace que la página vaya a: "tarjetapuntos.php"
__________________
Por fin.. tengo algo parecido a un blog
Y por lo visto ya estoy escribiendo...
  #8 (permalink)  
Antiguo 02/06/2010, 06:40
 
Fecha de Ingreso: abril-2010
Mensajes: 50
Antigüedad: 14 años
Puntos: 0
Respuesta: Ayuda DW y MYSQL

Mira mi duda es que qiero actualizar un dato de la bd porque ala hora de actualizar solo me actualizar el primero o el ultimo registro pero si fuera un dato de la mitad como haria espero haber sido claro x q de verdad enb lo anterior no fui muy claro graciasss
  #9 (permalink)  
Antiguo 02/06/2010, 13:12
Avatar de juaniquillo
Colaborador
 
Fecha de Ingreso: noviembre-2005
Ubicación: San Juan, Puerto Rico
Mensajes: 5.745
Antigüedad: 18 años, 5 meses
Puntos: 281
Respuesta: Ayuda DW y MYSQL

Se supone que cuando haces un formulario de editar DW te pide el campo donde guardas el ID de tu record para saber cuál es. Aquí explico como añadir y eliminar records usando DW:

http://www.forosdelweb.com/f17/eliminar-registro-dw8-475951/
__________________
Por fin.. tengo algo parecido a un blog
Y por lo visto ya estoy escribiendo...
  #10 (permalink)  
Antiguo 02/06/2010, 14:08
 
Fecha de Ingreso: abril-2010
Mensajes: 50
Antigüedad: 14 años
Puntos: 0
Respuesta: Ayuda DW y MYSQL

oye gracias pero mira eso es a lo que yo me refiero ahi aparecen todos los datos registrados pero lo que yo qiero es que solo me aparezca un dato espesifico antees buscado mediante un buscador en php y al encontrarlo modificarlo pero no q me muestre todos los datos de la tabala solo el dato que necesito editar espero me allas entendido gracias de ante mano
  #11 (permalink)  
Antiguo 03/06/2010, 11:43
Avatar de juaniquillo
Colaborador
 
Fecha de Ingreso: noviembre-2005
Ubicación: San Juan, Puerto Rico
Mensajes: 5.745
Antigüedad: 18 años, 5 meses
Puntos: 281
Respuesta: Ayuda DW y MYSQL

si quieres que ahí aparezca un record específico debes escogerlo primero. Es por eso que el método de hacerlo es, se listan los records, encuentras el que necesitas y luego lo envias ahí para ser editado., igual que lo hice en el ejemplo que te dí.
__________________
Por fin.. tengo algo parecido a un blog
Y por lo visto ya estoy escribiendo...
  #12 (permalink)  
Antiguo 03/06/2010, 15:36
 
Fecha de Ingreso: abril-2010
Mensajes: 50
Antigüedad: 14 años
Puntos: 0
Respuesta: Ayuda DW y MYSQL

disculpa pero en verdad no entiendo el ejemplo lo ago pero no me da lo q necesito gracias x leer mi problema
  #13 (permalink)  
Antiguo 06/06/2010, 09:00
Avatar de juaniquillo
Colaborador
 
Fecha de Ingreso: noviembre-2005
Ubicación: San Juan, Puerto Rico
Mensajes: 5.745
Antigüedad: 18 años, 5 meses
Puntos: 281
Respuesta: Ayuda DW y MYSQL

Creo que no nos estamos comunicando bien Diego. MI pregunta es ¿Cómo sabes cual es el record que quieres editar?
__________________
Por fin.. tengo algo parecido a un blog
Y por lo visto ya estoy escribiendo...
  #14 (permalink)  
Antiguo 09/06/2010, 14:37
 
Fecha de Ingreso: abril-2010
Mensajes: 50
Antigüedad: 14 años
Puntos: 0
Respuesta: Ayuda DW y MYSQL

mira lo que yo qiero es editar una persona espesifica q antes esa persona en un buscador ya implementado digito su documento de identidad el cual al verificar si si esta en la bd muestra los dato de esa persona pero al hacer click en editar me muestra los deotra persona lo que qiero es q me muestre lo de esa misma persona espero haber sido lo suficientement claro para tu ayuda graciasssssssss
  #15 (permalink)  
Antiguo 11/06/2010, 07:32
Avatar de juaniquillo
Colaborador
 
Fecha de Ingreso: noviembre-2005
Ubicación: San Juan, Puerto Rico
Mensajes: 5.745
Antigüedad: 18 años, 5 meses
Puntos: 281
Respuesta: Ayuda DW y MYSQL

ok, ahora entiendo. Lo que necesitas hacer es lo mismo que te dije que hicieras con el primer formulario formulario. Puede ser que no estás enviando el número de cédula correcto. Al tope de tu script pon lo siguiente:

Código PHP:
Ver original
  1. echo $_POST['cedula']

Para que sepas si estás enviando el numero de cédula de la persona que quieres editar.
__________________
Por fin.. tengo algo parecido a un blog
Y por lo visto ya estoy escribiendo...
  #16 (permalink)  
Antiguo 16/06/2010, 09:31
 
Fecha de Ingreso: abril-2010
Mensajes: 50
Antigüedad: 14 años
Puntos: 0
Respuesta: Ayuda DW y MYSQL

Oyeeee Dsclpa la ignorancia pero podrias espesificarme en donde ponerlo y que hacer para que me lo muestre graciassssssssss

Etiquetas: dw8, mysql
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 12:23.