PHP <= malfunctions when first number is less
up vote
0
down vote
favorite
I have the following code: $sql = "SELECT * FROM reward_table WHERE _cost <= '$_points' ORDER BY ID DESC"; $result = $conn->query($sql); while (($row = mysqli_fetch_assoc($result))) { $_title = $row_s['_title']; $_cost = $row_s['_cost']; $_id = $row_s['ID']; } When _cost is, for example, set at 8792, and $_points is 8793 then the particular reward shows. When _cost is updated to 8794 then it disappears, which is great - works. However... When _cost is set to 10000, it also shows? But, when I change _cost to 9000 it disappears as it should. I'm so confused - have I coded something wrong..? It appears like the code will only work if the starting digit of _cost is higher or the same as the starting digit of $_points . Your