I have a table as example below:
Prices
ID*low*high**value
1*1*4**29.0
2*5*9**32.0
3*10*25**50.0
low and high are both INT
I’ve tried:
$SQL = “SELECT value from Prices WHERE low >= ‘2’ AND high <= ‘2’
but I come up with zero (0) results returned where in this example I’m wanting to find 29.0
edited my table above as it was unclear after I saw it formated.
I cannot see a high <= 2 in your example above.
You might wanna review that.
$SQL = "SELECT value from Prices WHERE low >= '2' AND high <= '2'"The above code you showed us is correct.
I believe you want it switched around to find value 29.0:
$SQL = "SELECT value from Prices WHERE low <= '2' AND high >= '2'"