Custom post type search using $_SESSION and pre_get_posts

On your search form you use NULL (as a string) for Any selection.

When the form is submitted it is sent as a string with the contents of the word null.

Your isset then sees that, its set and sets the session to null (as a string). Which in turn messes up your query.

To fix use:

<option value="">Any</option>

and check with:

!empty()

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)