Find in Mysql

I’m trying to figure and can’t seem to find a way to do it,
this involves Mysql and php.
I need to find a row in a table that column b(see example)
that is greater than or equal to a variable, but i only need just one row, the closest matching one
varA represents COL A and varB represent varB

varA = 1
varB = 55,

I would need row 4, and the the number of rows between varA and what varB gives me, so 3.
Col A - Col B
1 - 5
2 - 10
3 - 20
4 - 50
5 - 100

any help?

$query = mysql_query(“SELECT * FROM table WHERE var = ‘$var’”) or die(mysql_error())

  1. I’m not a newbie, I know how to make SQL statements. thank you

2)That won’t work, AT ALL

so please re-read my post, and try again.

I need some a little more complicated. if you need clarification please say so.

Thank you.

Please Delete this post, or mark as solved.
thank you

wow !

Sponsor our Newsletter | Privacy Policy | Terms of Service