Let's say I have the following database table
id min max 1 0 0 2 1 90 3 91 180 4 181 365 5 366 0 So, what I need it to happen is this;
If I search for 0, I should get id=1 (min=0, max=0); if I search for 95, I should get id=3 (min=91, max=180); and for anything >=366, I should get id=5;