Codice PHP:
$Giorno_Dal = trim($_POST['Giorno_Dal']);
$Mese_Dal = trim($_POST['Mese_Dal']);
$Anno_Dal = trim($_POST['Anno_Dal']);
$Dal = "$Anno_Dal-$Mese_Dal-$Giorno_Dal";
$Giorno_Al = trim($_POST['Giorno_Al']);
$Mese_Al = trim($_POST['Mese_Al']);
$Anno_Al = trim($_POST['Anno_Al']);
$Al = "$Anno_Al-$Mese_Al-$Giorno_Al";
$Persone = trim($_POST['Persone']);
$Stanze = trim($_POST['Stanze']);
$query = "SELECT COUNT(d.ID) AS tot FROM Date AS d,Stanze AS s,Persone AS p WHERE d.Dal=$Dal AND d.Al=$Al AND s.Numero>=$Stanze AND p.Numero>=$Persone";
$result = mysql_query($query, $db);
$row = mysql_fetch_array($result);
$tot = $row["tot"];
echo $tot;
$tot è sempre 0 però