Código PHP:
include("conexion.php");
$link=Conectarse();
$dir = 'admin/multimedia/';
$total = 4;
$contador = 0;
$consulta = mysql_query("select id_album, album from album where not id_album = 6 order by id_album",$link);
?>
<p class="titulos">Album:</p>
<form action="<?php echo $PHP_SELF ?>">
<select onchange="this.form.submit();">
<?php while($album = mysql_fetch_array($consulta)){ ?>
<option value="<?php $id = $album['id_album']; echo $id?>"> <?php echo $album['album']?> </option>
<? } ?>
</select>
<?php $result = mysql_query("select url, thumb, descripcion, album from fotos inner join album on id_categoria = id_album where id_album = $id order by id_foto desc limit 16",$link); ?>
<table id="galeria">
<tr>
<?php
while($foto = mysql_fetch_array($result)){
?>
<td><a href="<? echo $dir.$foto['url']; ?>" rel="example1" title="<?php echo $foto['descripcion']; ?>"><img src="<? echo $dir.$foto['thumb']; ?>"></a></td>
<?
</form>
</table>
El value de cada option es 1 o 2 si lo pongo directamente en el where id_album = 2 si funciona pero si pongo la variable $id no funciona.