Hi,
I need to query my db using a date and then, if the query returns anything, I need to set a variable.
However I keep getting the error :
Function name must be a string
Can anyone help?
Thankyou
$host = "localhost";
$user = "root";
$pass = "";
$dbname = "test";
$connection = mysql_connect($host,$user,$pass) or die (mysql_errno().": ".mysql_error()."<BR>");
mysql_select_db($dbname);
$currentdate = "2006-04-12";
// check for events
// check for events
$sql = "SELECT * FROM date where '$currentdate' BETWEEN eventdate AND enddate";
$result = mysql_query($sql);
if (!$result) {
die('Invalid query: ' . mysql_error());
}
if ($mysql_num_rows($result)) { // see if we got 1 or more rows returned
$event = 1;
} else{
$event = 0;
}