I have 2 database tables (for a booking system) with the following structures:
quartos:
id_quarto
.tipo_quarto
Compare strings with LIKE
(if they aren't the index)
$strSQL = "SELECT id_quarto,tipo_quarto,vista_quarto FROM quartos,reservas WHERE quartos.id_quarto!=reservas.id_quarto AND quartos.tipo_quarto LIKE '". $_POST['tipo_quarto'] ."' AND quartos.vista_quarto LIKE '". $_POST['vista_quarto'] ."'";
The while
between closing ?>
tags can to be done different (it's clearer IMHO):
while($row = mysql_fetch_array($rs)) :
?>
and
and yeah, of course you'll have to do the actual mysql_query
, like the others pointed out!