In my database i have 2 columns namely: `Min and Max` they are varchar and they have number values which i need to compare with. My query is something like this

`SELECT * FROM Pricing_tbl WHERE Productid='10'`

and i have this to compare the price

```
while ($selected_row = $stmt - > fetch(PDO::FETCH_ASSOC)) {
    if ($marketval > $selected_row['Min'] && $marketval < $selected_row['Max']) {
        $price[] = array('price_level' => $selected_row['price_level']);
    }
}

```

This is ok if values of `Min` and `Max` are always numbers. But there is an instance where the value of `Max` is `above`. How to compare this situation?

Example values will be

[![enter image description here](https://i.stack.imgur.com/9Bs3I.png)](https://i.stack.imgur.com/9Bs3I.png)

Or should i just change the `Max` value. Any suggestion is appreciated