Código PHP:
<?php
$id=$_GET["cod"];
$consulta="SELECT af.idalbum AS idalbum, af.nombre_album as album,af.fecha_creacion AS fecha, a.ruta_foto as ruta
FROM album_fotos af
INNER JOIN fotos a ON
af.idalbum=a.idalbum
WHERE af.idalbum=$id";
$result=mysql_query($consulta,$conexion);
if(!$result){
die('Consulta invalida 1: '.mysql_error());
}
else{
$contador=mysql_num_rows($result);
if($contador==1){
while($row=mysql_fetch_array($result)){ ?>
<table width="578" height="138" border="1">
<form method="post"action="album_nro.php">
<tr >
<td width="566" valign="top"><p><font size=3 color="darkred"><b><h3>ALBUM:<?php echo $row['album']; ?></h3></b></font>
<p><b>Publicado el </b><?php echo $row['fecha']; ?><br>
<?php
$fotourl=$row['ruta'];
$ruta="imagenes/eventos/";
$ruta=$ruta.$fotourl;
//echo $ruta
echo "<br><br><img src=".$ruta." width=500 height=300 align=\"center\" ><br><br>";
?>
<input type="hidden" name="cod" value="<?php echo $row['idalbum']; ?>">
</p></tr>
</form>
</table><?php }
}
}?>
<p><br>
</p>
</td></tr>
</table>
El error que me manda es en la consulta, exactamente en la línea 5 de ésta, es decir en el WHERE.
No encuentro la solución al problema, ya que el id me direcciona correctamente, pero no muestra las fotos, mostrando ese error.
Espero puedan apoyarme. Saludos.