I have a mysql database with a column for "year" and the values currently stored are both 2 and 4 digits for each year, such as "18" and "2018".

I am trying to use LIKE to return records for both the 18 and 2018 where the user chooses "2018" for year in the html form.

So far, using the below approach, it only returns values for 2018 and not values where year data is stored just as "18"

I can see it passing "2018" value as it should in the URL and again, it works fine for returning results matching 2018. 

Here is the full query:

```
$year = $_GET['year'];

$query = "(
SELECT * 
FROM test
WHERE ('$name' IS NULL OR '$name' = '' OR name = '$name')
AND ('$city' IS NULL OR '$city' = '' OR city = '$city') AND ('$state' IS NULL 
OR '$state' = '' OR state = '$state') AND ('$county' IS NULL OR '$county' 
= '' OR county = '$county') AND ('$year' IS NULL OR '$year' = '' 
OR year LIKE '%$year%') AND ('$month' IS NULL OR '$month' = '' OR
month = '$month')order by name)";

```