Ver Mensaje Individual
  #9 (permalink)  
Antiguo 18/03/2006, 13:54
Avatar de ZydRick
ZydRick
 
Fecha de Ingreso: febrero-2005
Ubicación: Lima
Mensajes: 750
Antigüedad: 19 años, 2 meses
Puntos: 4
estas usando mal algunos echos, donde son innecesarios. Prueba de esta manera:

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

//conectamos con mysql
$conexion=mysqli_connect('localhost','root','','videoteca');
//comprobamos conexion a mysql, si no es correcta mostraremos mensaje
if($conexion==False){
  echo 
'error en la conexion con mysql';
}
//conectamos con bd (seleccionamos id de la tabla genero, ordenamos por id)
$result=mysqli_query($conexion"SELECT id,nombre,descripcion FROM genero ORDER BY id");

//comprobamos conexion con la tabla genero, si no es correcta mostrar mensaje
if($result==FALSE){
  echo 
'error en la conexion con genero';
}
//cerramos php para hacer tabla
?>
<p><table border="1" cellspacing="0" cellpadding="0" bordercolor="black" width="30%">
<tr>
<td><strong>Id</strong></td>
<td><strong>Nombre</strong></td>
<td><strong>Descripci&oacute;n</strong></td></tr>
<?php
    
//abrimos de nuevo y mostramos registros
    
while($row=mysqli_fetch_array($result)){
?>
<tr>
<td><?=$row['id']?></td>
<td><?=row['nombre']?></td>
<td><?=$row['descripcion']?></td>
</tr>
<?
    
}
    
//cerramos php, cerramos tabla y creamos una tabla con 2 columnas
?>
</table>
<p><table width="100%" border="1" >
<tr>
<td>    
<p>
<h3>Borrar registros</h3>
<form method="post" action="<?=$_SERVER['PHP_SELF']?>">
<select >
<?
    
//abrimos y mostramos registros en forma de menu desplegable
    
while($row2=mysqli_fecth_array($result)){
?>
    <option value="<?=$row2['id']?>"><?=$row2['id']?></option>
<?
    

    
//cerramos php y cerramos formulario, creamos boton borrar
?>
</select>
<input type="submit" value="borrar" name="enviar">
</form>
</td>
    <td>2</td>
</tr>

</table>
</body>
</html>
si te alguna falla pues ya sabes, aki estamos