Ma sei sicuro che i parametri di connessione siano corretti?
fai questa prova
Codice PHP:
<?php
$al = "2006-10-31";
$DBhost = "localhost";
$DBuser = "user";
$DBpass = "password";
$DBName = "nome_db";
$table = "nome_tabella";
$conn = mysql_connect($DBhost,$DBuser,$DBpass) or die(mysql_error() );
mysql_select_db("$DBName") or die(mysql_error() );
$sqlquery = "SELECT * FROM $table WHERE end_date between '$dal' and '$al' ";
$result = mysql_query($sqlquery) or die(mysql_error() );
while ($row = mysql_fetch_assoc($sqlquery) )
{
$thename = $row['title'];
$theemail = $row['description'];
$thestartdate = $row['start_date'];
$theenddate = $row['end_date'];
echo $thename.' '.$theemail.' '.$thestartdate.' '.$theenddate.'
';
}
?>