Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/08/2010, 00:29
kale60
 
Fecha de Ingreso: agosto-2010
Mensajes: 10
Antigüedad: 13 años, 8 meses
Puntos: 0
insertar y borrar

Wenas soy nuevo en esto, tengo una duda .
tengo este codigo y mi pregunta es como podria a la vez que borro el registro en la tabla archivo insertarlo en otra tabla, gracias de antemano:

<?
include "conexionsantotomas.php";

if (!isset($accion)){
$result=mysql_query("SELECT * FROM archivo WHERE id='$id'",
$conexion);
$row=mysql_fetch_row($result);
echo"<html>
<head><title>Actualizar datos de la base</title></head>
<body>
<form action=\"borrar.php?accion=borrar\" method=\"POST\">
Nombre:<br>
<input type=\"text\" value=\"$row[1]\" name=\"nombre\"><br>
Apellidos:<br>
<input type=\"text\" value=\"$row[2]\" name=\"apellidos\"><br>
Direccion:<br>
<input type=\"text\" value=\"$row[3]\" name=\"direccion\"><br>
Codigo Postal:<br>
<input type=\"text\" value=\"$row[4]\" name=\"codigopostal\"><br>
Poblacion:<br>
<input type=\"text\" value=\"$row[5]\" name=\"poblacion\"><br>
Telefono Fijo:<br>
<input type=\"text\" value=\"$row[6]\" name=\"telefonofijo\"><br>
Telefono Movil:<br>
<input type=\"text\" value=\"$row[7]\" name=\"telefonomovil\"><br>
Fecha de Nacimiento:<br>
<input type=\"text\" value=\"$row[8]\" name=\"fechanacimiento\"><br>
Cargo Agrupacion:<br>
<input type=\"text\" value=\"$row[9]\" name=\"cargoagrupacion\"><br>
Cargo Cofradia:<br>
<input type=\"text\" value=\"$row[10]\" name=\"cargocofradia\"><br>
Fecha de Inscripcion:<br>
<input type=\"text\" value=\"$row[11]\" name=\"fechadeinscripcion\"><br>
Observaciones:<br>
<input type=\"text\" value=\"$row[12]\" name=\"observaciones\"><br>
<input type=\"hidden\" name=\"id\" value=\"$row[0]\">
<input type=\"submit\" value=\"Borrar\">
</form>
</body>
</html>";
}elseif($accion==borrar){
$result=mysql_query("DELETE FROM archivo WHERE id='$id'",$conexion);
if(!$result){
echo '<b style="font-size:20px">'.mysql_error().'</b>';
}
echo"
<html>
<body>
<h3>Los registros han sido borrados</h3>
</body>
</html>";
}
include "cerrar_conexion.php";
?>