How can the DATE_ADD function be used to manipulate dates in MySQL queries?

The DATE_ADD function in MySQL can be used to manipulate dates by adding a specified time interval to a given date. This function is useful for tasks like adding days, months, or years to a date. By using DATE_ADD in MySQL queries, you can easily perform date calculations and adjustments within your database operations.

// Example of using DATE_ADD function in MySQL query
$query = "SELECT DATE_ADD(date_column, INTERVAL 1 DAY) AS new_date FROM table_name";
$result = mysqli_query($connection, $query);

if ($result) {
    while ($row = mysqli_fetch_assoc($result)) {
        echo $row['new_date'] . "<br>";
    }
} else {
    echo "Error: " . mysqli_error($connection);
}