Ver Mensaje Individual
  #3 (permalink)  
Antiguo 17/03/2006, 18:43
gingerk
 
Fecha de Ingreso: enero-2006
Mensajes: 140
Antigüedad: 18 años, 3 meses
Puntos: 0
no funciona :(

Código PHP:
<html>
<head>
<title> mostrar, añadir, borrar registros</title>
</head>
<body>
<p><h3>Borrar registros</h3>

<?php

//contiene dos paginas registros.php y registros2.php
//conexion con mysql
$conexion=mysqli_connect('localhost','root','','videoteca') ;

//comprobacion conexion
//si la conexion no es valida
if($conexion==FALSE){
  echo 
'error en la conexion';
}
//creamos formulario
echo '<FORM METHOD="POST" ACTION="registros2.php">ID<br>';
//conexion con la tabla genero
$result=mysqli_query(
    
$conexion,
    
'SELECT id FROM genero ORDER BY id ');

echo 
'<select name="id">';


//Mostramos los registros en forma de menú desplegable
while ($row=mysqli_fetch_array($result)){
  echo 
'<option value="$row["id"]">'.$row["id"];}
mysqli_free_result($result)
?>
</select>

<br>
<INPUT TYPE="SUBMIT" value="Borrar">
</FORM>
</body>
</html>


Código PHP:
<html>
<head>
<title> mostrar, añadir, borrar registros</title>
</head>
<body>
<p>

<?php

//contiene dos paginas registros.php y registros2.php
//conexion con mysql
$conexion=mysqli_connect('localhost','root','','videoteca') ;

//comprobacion conexion
//si la conexion no es valida
if($conexion==FALSE){
  echo 
'error en la conexion';
}

//conexion con la tabla genero
$result=mysqli_query(
    
$conexion,
    
"Delete From genero Where id='".$_POST['id']."'");



?>
<h1><div align="center">Registro Borrado</div></h1>
<div align="center"><a href="registros.php">Volver</a></div>
</body>
</html>
por favor, no me cambieis la estructura de mi codigo por que sino me no me entero, esque estoy aprendiendo y si me añadiis cosas nuevas me liais mas por q no se su significado ni de donde salen.

cuando me salga esto probare lo del include. thanks