I want to put the uses date of birth into the database..so I wrote this function:
function setAge($day, $month, $year)
{
$date= strtotime("$day $month $year");
mysql("UPDATE controlpanel
SET date_of_birth=$date
WHERE=".this->$userID) or die(mysql_error());
}
I am not sure if this is correct, or the best way to update the date. The field variable is DATE, .. I dont insert dates, I just update it..will it cause an error? is this the best way to put a date from php to mysql?