I got mysql table like this
id | type | number
1 | c | 2
2 | c | 10
3 | c | 20
Also i got PHP array with values:
$array[c] = 5;
$array[d] = 10;
I wanna do something like this
( SELECT * FROM table WHERE number >= $array[ type ] )
so that type could be taken from mysql column somehow and used for finding correct value from array.
Thats kinda tricky, but I'm not sure how better I could ask.
$array[c]is an integer, what exactly prevents you from using it as parameter?where type = c and number >= 5for the$array[c] = 5;you mean?WHERE (type = c AND number > 5) OR (type = d AND number > 10)