'How to show alert message with define range in php from mysql

In mysql there are 1 to 10 numbers available in table colum, i am fetching number and want to show alert message when number range 1 to 10 or more there are show alert "numbers are enaught". You can alert message show through javascript but embedded with php.

<?php
    $sql_query = "SELECT * FROM dndorder ORDER BY display_order";
    $resultset = mysqli_query($conn, $sql_query) or die("database error:". mysqli_error($conn));
    $data_records = array();
    while( $row = mysqli_fetch_assoc($resultset)) {
        echo $row['id'];
        if($row==10){
            foreach (range($row, 10) as $number) {
                echo 'exceed num';
            }
        }
    }


Solution 1:[1]

@Simone Rossaini

this range define 0 to 9 values

this range define 0 to 9 but disorder way

Actually the numbers keep changing and the numbers keep increasing.

For example if row still showing 10 but now i want to increase some more row with others colums data may be row get reach 2 more so number will show till 0 to 11 total count 12. I want show message, when last value increase with assending order like 1 2 3 4 5 6 7 8 9 10 11 last value increase 12 just show message "Last value has been increased is 12".

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Imran Haider