Hola de nuevo,
En mi página tengo un combo dinámico:
Código PHP:
<form action="consultas.php" method="post" enctype="multipart/form-data">
<select name="comboxedi">
<?php
$sql = "SELECT DISTINCT libro.editorial FROM libro JOIN prestamo ON prestamo.titulo=libro.titulo WHERE prestamo.estado = 'Disponible' ORDER BY libro.editorial;";
$QUERY = mysql_query( $sql ) or die (mysql_error());
echo '<option value="0">Seleccione..</option>';
while( $fil = mysql_fetch_assoc( $QUERY ) ) {
echo '<option value="'.$fil['editorial'].'" >'.$fil['editorial'].'</option>';
}
?>
</select>
<input name="enviar" type="submit" value="enviar" />
</form>
Para el cual capturo via POST el resultado del mismo
Luego tengo esta tabla:
Código PHP:
<table id="librosxedit" width="475" border="1" style="text-align:center;">
<tr>
<th scope="col">Titulo</th>
<th scope="col">Estado</th>
</tr>
<?php $sql = "SELECT libro.titulo, prestamo.estado FROM libro JOIN prestamo ON prestamo.titulo = libro.titulo WHERE prestamo.estado = 'Disponible' AND libro.editorial = '$valor' ORDER BY libro.titulo; ";
$QUERY = mysql_query( $sql ) or die (mysql_error());
while ( $fil = mysql_fetch_assoc($QUERY) ) { ?>
<tr>
<td><?php echo $fil['titulo']; ?></td>
<td><?php echo $fil['estado']; ?></td>
<?php }?>
</tr>
</table>
Lo que me gustaria hacer es que si la opcion por defecto esta seleccionada, no muestre nada en la tabla pero si selecciona uno de los valores disponibles, hace la consulta y actualiza los campos con los datos correspondientes..
Me pasa que la tabla esta tomando un valor por defecto que nunca seleccione