How to use is null in find_in_set in php


I am trying to use IS NULL in query but it is not working for me


‘select * from tbl_user_reg where prof_verify_status=:stat and FIND_IN_SET(age, is null
or age, :agefrom) order by user_id desc’;

can u find any error …?

Darshan N


This isn’t valid sql:

  and FIND_IN_SET(
    is null or age,

A person’s age is not a fixed number, unless they are dead. You should be storing a date of birth and then either calculating the current age or determining a date range in order to find matching data.


Got it,
thank you,