Ver Mensaje Individual
  #12 (permalink)  
Antiguo 12/03/2012, 19:05
rimox
 
Fecha de Ingreso: marzo-2012
Mensajes: 17
Antigüedad: 12 años, 1 mes
Puntos: 0
Respuesta: Modificar tablas desde formulario php

haber mis datos estan asi ahora:

buscaequipo.php

Código PHP:
<html>
<body>
<?php
   
include("conec.php");
   
$link=Conectarse();
   
$Sql="select * from primedivision where id like '%".$_REQUEST["id"]."%'";
   
$result=mysql_query($Sql,$link);
?>
<table border="1" cellspacing="1" cellpadding="1">
<tr>
<td>&nbsp;Equipo&nbsp;</td>
<td>&nbsp;GF&nbsp;</td>
<td>&nbsp;GC&nbsp;</td>
<td>&nbsp;Puntos&nbsp;</td>
</tr>
<form name="form1" method="post" action="modificaequipopri.php">
<?php    
   
while($row mysql_fetch_array($result))
   {
printf("<tr><td>&nbsp;<INPUT TYPE='text' NAME='nombre' SIZE='20' MAXLENGTH='30' value='%s'>&nbsp;</td><td>&nbsp;<INPUT TYPE='text' NAME='favor' SIZE='20' MAXLENGTH='30' value='%s'>&nbsp;</td><td>&nbsp;<INPUT TYPE='text' NAME='contra' SIZE='20' MAXLENGTH='30' value='%s'>&nbsp;</td><td>&nbsp;<INPUT TYPE='text' NAME='puntos' SIZE='20' MAXLENGTH='30' value='%s'>&nbsp;</td></tr>"$row["id_equipo"],$row["gf"],$row["gc"],$row["ptos"]);
   }
   
mysql_free_result($result);
?>

   <input type="submit" name="accion" value="Guardar">
</form>
</body>
</html>
y el modificaequipopri.php

Código PHP:
<?php
   
include("conec.php");
   
$link=Conectarse();   
$Sql="UPDATE primedivision SET  id_equipo='".$_POST["nombre"]."', gf='".$_POST["favor"]."', gc='".$_POST["contra"]."', ptos='".$_POST["puntos"]."' WHERE id='".$_POST["id"]."'";
   
mysql_query($Sql,$link);
   
header("Location: consultaequipopri.php");
?>
pero no modifica los registros aun