Hi all,
I have a search page where I'd like members to be able to search for races that they and their friends have entered into a database. When entering the data, users put the race date into the race_date field (Which is a DATETIME field) in the table.
I've set up the search and display pages, so users can search by a number of other criteria (first name, last name, race distance, time, etc), but am having trouble with searching by year. On my search form, is a field called race_year.
So, obviously I need some change in the code below, specifically in relation to the line $where .= " AND race_date='$race_year'"; because I want to extract the year part of the race_date column from the table and see if it matches $race_year .
Any advice would be appreciated.
Cheers,
Dave
$race_year = $_POST['race_year'];
if ($race_year != '')
{ // A year is selected
$where .= " AND race_date='$race_year'";
}