Ver Mensaje Individual
  #5 (permalink)  
Antiguo 22/10/2012, 15:34
edward_bukowski_1980
 
Fecha de Ingreso: octubre-2012
Ubicación: Caracas, Venezuela
Mensajes: 31
Antigüedad: 11 años, 6 meses
Puntos: 0
Respuesta: Relaciones de tablas

Sera que el problema esta aqui, pero yo no lo veo, ayuda por favor.

Código PHP:
<?php 

require ("funciones2.php");

$idc conectar();

$sql="SELECT * FROM musica m, generos g  WHERE m.idg = g.idg";
//$sql2="SELECT * FROM musica m, generos g  WHERE m.idg = g.idg";

$res1 ejecutar ($sql,$idc);
$res2 ejecutar ($sql,$idc);

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sistema de rock</title>
<link href="formato1.css" rel="stylesheet" type="text/css" />
</head>

<body>
<form action="agregar.html" method="post" id="agregar" name="agregar" >
<form action="buscar.html" method="post" id="buscar" name="buscar" >

<table width="1019" height="79" align="center"  class="color1" id="Listar">
<caption>
<br />
<br />
LISTADO DE REGISTRO DE CD DE MÚSICA<br />
<br /><br />
<br /><input type="submit"  formaction="agregar.html"  name="agregar" id="agregar" value="Agregar" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit"  formaction="buscar.html" name="buscar" id="buscar" value="Buscar" /><br />
<br /></caption>
  <tr>
    <th width="58" align="center">Id</th>
    <th width="207" align="center">Album</th>
    <th width="172" align="center">Artista</th>
    <th width="109" align="center">Canciones</th>
   
    <th width="275" align="center">Generos</th>
    <th width="58" align="center">Año</th>
    <th width="80" align="center">Imagen</th> 
   
  </tr>


 
  <?php 
  $total 
totalRegistros($res1);
   
  for (
$i=0$i<$total$i++) {
      
$fila getRegistro($res1);
      
  
?>
  
  
  
   <tr>
   <td align="center"><?php echo $fila['id']; ?></td>
    <td align="center"><a href="modificar.php?id=<?php echo $fila['id']; ?>"><?php echo $fila['album']; ?></a></td>
    
    <td align="center"><?php echo $fila['artista']; ?></td>
   <td align="center"><?php echo $fila['canciones']; ?></td>
  
  
    <?php 

   $total2 
totalRegistros2($res2);
  for (
$i=0$i<$total2$i++) {
      
       
$fila2 getRegistro2($res2);
  
?>
   <td align="center"><?php echo $fila2['genero1']; ?><?php echo " " ?>
    <?php echo $fila2['genero2']; ?><?php echo " " ?>
    <?php echo $fila2['genero3']; ?><?php echo " " ?>
    <?php echo $fila2['genero4']; ?><?php echo " " ?>
    <?php echo $fila2['genero5']; ?><?php echo " " ?>
    <?php echo $fila2['genero6']; ?><?php echo " " ?>
    <?php echo $fila2['genero7']; ?><?php echo " " ?>
    <?php echo $fila2['genero8']; ?><?php echo " " ?>
   
   </td>
     <?php ?>
   <td align="center"><?php echo $fila['ano']; ?></td>
   
   
   
   <td width="80"><?php echo "<img src='Imagenes/" .$fila['imagen']. "' height='80'/>"?> </td>
<td width="26" align="center" > <a href="eliminar.php?id=<?php echo $fila['id']; ?>"><img src="imagenes/eliminar.png" width="16" height="16" border = "0"/></a> </td> 
  <?php ?>
 
 </tr>
</table>
</body>
</html>
<?php 
cerrar 
($idc);
?>
Este archivo es listar.php