I'm bashing my head for some time now on how to resolve this issue (using PHP and MySQL) ...
$array = ['C1', 'C2', 'C3', 'C4', 'C5', 'T1', 'T2', 'T3', 'T4', 'T5', 'T6', 'L1', 'L2', 'L3', 'L4', 'L5']
I'm getting in request 2 parameters: value_from and value_to
Each record in the db table has those 2 columns (value_from and value_to)
Say for example i have 2 records looking like this:
id: 2, name: test1, value_from: C1, value_to: L3
id: 3, name: test2, value_from: C3 value_to: T5
in the request i get this json payload:
value_from: C4,
value_to: L2
with this parameters i should somehow retrieve 1 record - with the id: 2 because input parameters fit the range
Any idea how this might be possible or what should the sql query look like?
P.S. The $array is just a code representation of user selected input based on the front and yes, it cannot be changed, rearranged, meaning it has to look like that