What is the significance of the numbers in the LIMIT clause when using DESC in a MySQL query?

When using the DESC keyword in a MySQL query, the LIMIT clause determines the number of rows to return starting from the end of the result set. For example, if you use LIMIT 5 with DESC, it will return the last 5 rows based on the sorting order specified in the query. To get the desired results, make sure to adjust the LIMIT clause accordingly to fetch the correct number of rows from the end of the result set.

$query = "SELECT * FROM table_name ORDER BY column_name DESC LIMIT 5";
$result = mysqli_query($connection, $query);

while($row = mysqli_fetch_assoc($result)) {
    // Process each row here
}