Pues bien estoy atorado en la parte de las modificaciones ya que para realizarlas lo hago por medio de dos archivos, la primera es aquella en la que se muestran los datos a actualizar dependiendo de la busqueda (actualizar.php) y el segundo es el que se encarga de guardar los datos ya actualizados (actualizar_procesar.php).
Mi problemas es con este ultimo archivo, ya que no se como hacer para que me guarde los datos ya actualizados, espero que me puedan ayudar a resolver ste problema.
Aqui el codigo de los archivos:
busqueda.php
Código:
actualizar.php<?php require_once('Connections/futbol.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $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": $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; } } $colname_mostrar_datos = "-1"; if (isset($_POST['busqueda'])) { $colname_mostrar_datos = $_POST['busqueda']; } mysql_select_db($database_futbol, $futbol); $query_mostrar_datos = sprintf("SELECT * FROM datos_jugador WHERE nombre LIKE %s", GetSQLValueString("%" . $colname_mostrar_datos . "%", "text")); $mostrar_datos = mysql_query($query_mostrar_datos, $futbol) or die(mysql_error()); $row_mostrar_datos = mysql_fetch_assoc($mostrar_datos); $totalRows_mostrar_datos = mysql_num_rows($mostrar_datos); ?> <!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=utf-8" /> <title>Busqueda</title> <style type="text/css"> <!-- #apDiv1 { position:absolute; width:817px; height:115px; z-index:1; left: 130px; top: 85px; } #apDiv2 { position:absolute; width:457px; height:46px; z-index:2; left: 326px; top: 21px; } --> </style> </head> <body> <div id="apDiv1"> <table width="954" border="1"> <tr> <td width="322">NOMBRE</td> <td width="140">APODO</td> <td width="182">NACIONALIDAD</td> <td width="138">ACTUALIZAR</td> <td width="138">BORRAR</td> </tr> <tr> <td><?php echo $row_mostrar_datos['nombre']; ?> <?php echo $row_mostrar_datos['ap_pat']; ?> <?php echo $row_mostrar_datos['ap_mat']; ?></td> <td><?php echo $row_mostrar_datos['apodo']; ?></td> <td><?php echo $row_mostrar_datos['nacionalidad']; ?></td> <td><a href="actualizar.php?id_jugador=<?php echo $row_mostrar_datos['id_jugador']; ?>" >ACTUALIZAR</a></td> <td><a href="eliminar.php?id_jugador=<?php echo $row_mostrar_datos['id_jugador']; ?>" >BORRAR</a></td> </tr> </table> </div> <div id="apDiv2"> <form id="form1" name="form1" method="post" action="busqueda.php"> ESCRIBE UN NOMBRE <label> <input type="text" name="busqueda" id="busqueda" /> </label> <label> <input type="submit" name="enviar" id="enviar" value="BUSCAR" /> </label> </form> </div> </body> </html> <?php mysql_free_result($mostrar_datos); ?>
Código:
Como les digo, no se como hacer el archivo actualizar_procesar.php que guarde los datos ya actualizados. <!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=utf-8" /> <title>Actualizar</title> <style type="text/css"> <!-- #apDiv1 { position:absolute; width:948px; height:448px; z-index:1; left: 38px; top: 49px; } --> </style> </head> <body> <?php $conexion = mysql_connect ("localhost", "usuario", "pass"); mysql_select_db ("sistema"); $id_jugador=$_GET["id_jugador"]; $result=mysql_query("SELECT * FROM datos_jugador WHERE id_jugador = ".$id_jugador.";"); $row = mysql_fetch_array($result); ?> <div id="apDiv1"> <form action="actualizar_procesar.php?id_jugador=<? print $id_jugador; ?>" method="post" enctype="multipart/form-data" name="formDatos" id="formDatos"> <p>NOMBRE: <label> <input type="text" name="nombre" id="nombre" value= "<? print $row ['nombre']; ?>" placeholder="Escriba el nombre" onkeyup="this.value=this.value.toUpperCase();"/> </label> APELLIDO PATERNO: <label> <input type="text" name="ap_pat" id="ap_pat" value= "<? print $row ['ap_pat']; ?>" placeholder="Escriba el apellido paterno" onkeyup="this.value=this.value.toUpperCase();"/> </label> APELLIDO MATERNO: <label> <input type="text" name="ap_mat" id="ap_mat" value= "<? print $row ['ap_mat']; ?>" placeholder="Escriba el apellido materno" onkeyup="this.value=this.value.toUpperCase();"/> </label> <br /> <br /> APODO: <label> <input type="text" name="apodo" id="apodo" value= "<? print $row ['apodo']; ?>" placeholder="Escriba el apodo" onkeyup="this.value=this.value.toUpperCase();"/> </label> </p> <p>NACIONALIDAD: <label> <input type="text" name="nacionalidad" id="nacionalidad" value= "<? print $row ['nacionalidad']; ?>" placeholder="Escriba la nacionalidad" onkeyup="this.value=this.value.toUpperCase();"/> </label> </p> <p>EDAD: <label> <input type="text" name="edad" id="edad" value= "<? print $row ['edad']; ?>" placeholder="Escriba la edad" onkeyup="this.value=this.value.toUpperCase();"/> </label> AÑOS ALTURA: <label> <input type="text" name="altura" id="altura" value= "<? print $row ['altura']; ?>" placeholder="Escriba la altura" onkeyup="this.value=this.value.toUpperCase();"/> </label> PESO: <label> <input type="text" name="peso" id="peso" value= "<? print $row ['peso']; ?>" placeholder="Escriba el peso" onkeyup="this.value=this.value.toUpperCase();"/> </label> KG.</p> <p>POSICION: <label> <select name="posicion" id="posicion" value= "<? print $row ['posicion']; ?>"> <option selected="selected">Seleccione una posicion</option> <option value="PORTERO">PORTERO</option> <option value="DEFENSA">DEFENSA</option> <option value="MEDIO">MEDIO</option> <option value="DELANTERO">DELANTERO</option> </select> </label> </p> <p>NUMERO: <label> <input type="text" name="numero" id="numero" value= "<? print $row ['numero']; ?>" placeholder="Escriba el numero" onkeyup="this.value=this.value.toUpperCase();"/> </label> </p> <p>IMAGEN: <label> <input type="file" name="imagen" id="imagen"/> </label> </p> <p><img src="imagenes/imagenes_jugadores/<?php echo $row['imagen']; ?>" width="125" height="125" /> IMAGEN ACTUAL</p> <p>HABILIDAD: <label> <input type="text" name="habilidad" id="habilidad" value= "<? print $row ['habilidad']; ?>" placeholder="Escriba alguna habilidad" onkeyup="this.value=this.value.toUpperCase();"/> </label> </p> <p>COMENTARIOS: <label> <textarea name="comentarios" id="comentarios" cols="30" rows="5" value= "<? print $row ['comentarios']; ?>" placeholder="Escriba algun comentario" onkeyup="this.value=this.value.toUpperCase();"></textarea> </label> <br /> </p> <p> <label> <input type="submit" name="enviar" id="enviar" value="GUARDAR DATOS" /> </label> </p> </form> </div> </body> </html>
De antemano gracias por la ayuda.