Thanks for the replies. However this is weird, because i have a similar page that accepts those dates just fine.
//This is the code that flags up the error:
$query = "SELECT *
FROM tbladult
WHERE adultid = '$adultid'";
$result = mysql_query($query);
if(!$result) error_message(sql_error());
if (!$myrow = mysql_fetch_array($result)) echo "Sorry, no records were found!";
$startdatevalues = explode("-", $myrow["adultDOB"]);
$startyear = $startdatevalues[0]; // year
$startmonth = $startdatevalues[1]; // month
$startday = date("d", mktime(0, 0, 0, 0, $startdatevalues[2], 0)); // day
// this code works fine
$query = "SELECT *
FROM tblpupil
WHERE pupilid = '$pupilid'";
$result = mysql_query($query);
if(!$result) error_message(sql_error());
if (!$myrow = mysql_fetch_array($result)) echo "Sorry, no records were found!";
$startdatevalues = explode("-", $myrow["pupilDOB"]);
$startyear = $startdatevalues[0]; // year
$startmonth = $startdatevalues[1]; // month
$startday = date("d", mktime(0, 0, 0, 0, $startdatevalues[2], 0)); // day
?>