![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
30/12/2008, 01:37
|
| | Fecha de Ingreso: noviembre-2008
Mensajes: 259
Antigüedad: 16 años, 2 meses Puntos: 1 | |
Respuesta: Actualizando MySQL He intentado, pero no me actualiza el campo.
Este es el código actual:
Gracias!!
<?php
$con = mysql_connect('localhost','root','');
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("orhayeladim", $con);
if($_POST['submit']){
//primero la conexion
mysql_query("UPDATE usuarios SET aceptado='".$_POST['aceptado']."' WHERE id='".$_POST['id']."' LIMIT '1',$con");
}
?>
<form action="aceptar.php" method="post" name="aceptado[id]">
<?php
$result = mysql_query("SELECT * FROM usuarios WHERE aceptado='0' ORDER BY dateJoined DESC");
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<font face=Arial color=#003366 size=2>"."ID: " . $row['id'] ."<br>";
echo "<font face=Arial color=#003366 size=2>". "NOMBRE: ".$row['nombre'] ."<br>";
echo "<font face=Arial color=#003366 size=2>". "APELLIDO: ".$row['apellido'] ."<br>";
echo "<font face=Arial color=#003366 size=2>". "EMAIL: ".$row['email'] ."<br>";
echo "<font face=Arial color=#003366 size=2>". "FECHA INSCRIPCION: ".$row['dateJoined'] ."<br>";
echo '<input type="hidden" name="id" value=" ' . $row['id'] .'" />';
?>
<label>
<input name="aceptado" type="text" id="aceptado" value="<?php echo $row['aceptado']?>" size="5" maxlength="1" />
</label>
<label>
<?php
echo "<hr noshade />";
}
mysql_close($con);
?>
<input type="submit" name="submit" id="submit" value="submit" />
</label></form> |