mis archivos son los siguientes:
consultaequipo.php
Código PHP:
<html>
<head>
<title>Modifica Equipo</title>
</head>
<body>
<h1>Modificar equipo</h1>
<form action="buscaequipo.php" method="post">
Equipo:
<input type="text" name="nombre" size="20" maxlength="30">
<input type="submit" name="accion" value="Buscar">
</FORM>
</body>
</html>
Código PHP:
<html>
<body>
<?php
include("conec.php");
$link=Conectarse();
$Sql="select * from ligascenso where id like '%."$_POST["nombre"]."%'";
$result=mysql_query($Sql,$link);
?>
<table border="1" cellspacing="1" cellpadding="1">
<tr>
<td> ID</td>
<td> EQUIPO </td>
<td> GF </td>
<td> GC </td>
<td> PUNTOS </td>
</tr>
<form name="form1" method="post" action="modificaequipo.php">
<?php
while($row = mysql_fetch_array($result))
{
printf("<tr><td><INPUT TYPE='text' NAME='id' SIZE='20' MAXLENGTH='30' value='id'></td><td> <INPUT TYPE='text' NAME='nombre' SIZE='20' MAXLENGTH='30' value='id_equipo'> </td><td> <INPUT TYPE='text' NAME='favor' SIZE='20' MAXLENGTH='30' value='gf'> </td><td> <INPUT TYPE='text' NAME='contra' SIZE='20' MAXLENGTH='30' value='gc'> </td><td> <INPUT TYPE='text' NAME='puntos' SIZE='20' MAXLENGTH='30' value='ptos'> </td></tr>", $row["id"],$row["id_equipo"],$row["gf"],$row["gc"],$row["ptos"]);
}
mysql_free_result($result);
?>
<input type="submit" name="accion" value="Guardar">
</form>
</body>
</html>
Código PHP:
<?php
include("conec.php");
$link=Conectarse();
$Sql="UPDATE ligascenso SET id='".$_POST["id"]."', id_equipo='".$_POST["nombre"]."', gf='".$_POST["favor"]."', gc='".$_POST["contra"]."' ptos='".$_POST["puntos"]."' WHERE id_equipo='".$_POST["nombre"]."'";
mysql_query($Sql,$link);
header("Location: consultaequipo.htm");
?>
Código PHP:
<?php
function Conectarse(){
if (!($link=mysql_connect("localhost","root",""))) {
exit();
}
if (!mysql_select_db("proevo",$link)){
exit();
}
return $link;
}
?>
Cita:
( ! ) Parse error: syntax error, unexpected T_VARIABLE in C:\wamp\www\pes\admin\equipo\buscaequipo.php on line 6