How can backticks be used to handle column names that consist only of numbers in PHP MySQL queries?

When column names consist only of numbers in MySQL queries in PHP, backticks (`) can be used to handle them. By wrapping the column names in backticks, MySQL will interpret them as identifiers rather than numeric values. This prevents any syntax errors that may occur due to using numeric column names in queries.

$query = "SELECT `123`, `456` FROM table_name";
$result = mysqli_query($connection, $query);

if($result){
    while($row = mysqli_fetch_assoc($result)){
        // Process the fetched data
    }
} else {
    echo "Error: " . mysqli_error($connection);
}