Ver Mensaje Individual
  #3 (permalink)  
Antiguo 04/09/2008, 14:13
Avatar de hoberwilly
hoberwilly
 
Fecha de Ingreso: julio-2008
Ubicación: Lima - Perú
Mensajes: 769
Antigüedad: 15 años, 9 meses
Puntos: 2
Respuesta: Update a Imagen guardada en BD

Quizas algo así Ronruby...
editarAdmin.php
<?php
include('conec.php');
conectarse();
$registro=mysql_query("select * from catalogo where id='".$_GET['id']."'");
$row=mysql_fetch_array($registro);
?>

<html>
<head>
<title>Editando Catalogo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="form2" method="post" action="actualizarAdmin.php?id=<?php echo $row["id"];?>">
<table>
<tr>
<td colspan="2" align="center">ACTUALIZACION DEL ARTICULO</td>
</tr>
<tr>
<td>Imagen</td>
<td align="center"><?php echo "<img src=\"verThumbnail2.php?id=".$row['id']."\">"; ?><br><?php echo $row["id"]?></td>
</tr>
<tr>
<td>Producto</td>
<td><input name="producto" type="text" id="producto" size="50" maxlength="45" value="<?php echo $row["producto"]?>"></td>
</tr>
<tr>
<td>Descripcion</td>
<td><textarea name="descripcion" rows="5" cols="39" id="descripcion"><?php echo $row["descripcion"]?></textarea></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="Submit" name="Submit" value="Actualizar"></td>
</tr>
</table>
</form>
</body>
</html>

Lo que faltaría seria implementarlo un input para la nueva imagen quizas???? y modificarlo el actualizarAdmin.php
<?
include('conec.php');
conectarse();
$ids=$_GET['id'];
$producto=$_POST['producto'];
$descripcion=$_POST['descripcion'];
$sql="update catalogo set producto='$producto', descripcion='$descripcion' where id='$ids'";
mysql_query($sql) or die( "Error en $sql, error: " . mysql_error() );
header("location:catalogoAdmin.php");
?>