Code : Tout sélectionner
$requete= "SELECT chambre.numchambre, chambre.etage, chambre.prix, chambre.num_type FROM chambre
JOIN reserver
ON chambre.numchambre = reserver.numchambre
WHERE num_type = (SELECT num_type
FROM type
WHERE categorie = ".$type.")
AND ".$datedebu." NOT BETWEEN datdebu AND datfin
Or( ".$datefin." NOT BETWEEN datdebu AND datfin)";
echo "<br>";
$result=mysql_query($requete,$dbh);
$row=mysql_num_rows($result) or die(mysql_error());
while ($row= mysql_fetch_array($result))
{
?><form name="dispo" action="choix.php" method="post">
<fieldset>
<table border="0" cellpadding="0" cellspacing="0"width="100%" height="100%">
<?
echo '<table>chambre : '.$type.' <tr><td>'.$prix. ' euros <tr><td>du '.$datdebu.' au '.$datfin.' pour '.$nbadulte.' adulte(s) et '.$nbenfant.' enfant(s) </table>';
?> <input type="submit" name="bt_resa" value="reserver">
</fieldset><td>
<tr> </fieldset>
</form>
<?
}
mysql_num_rows(): supplied argument is not a valid MySQL result
ligne :
Code : Tout sélectionner
$row=mysql_num_rows($result) or die(mysql_error());
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'double) AND 1185919200 NOT BETWEEN datdebu AND datfin Or( 1186005600' at line 6