How can you compare a DATE column with a TIMESTAMP column in a MySQL WHERE clause?

When comparing a DATE column with a TIMESTAMP column in a MySQL WHERE clause, you can use the DATE() function to extract the date portion of the TIMESTAMP column for comparison. This allows you to compare the two columns based on their date values only, ignoring the time component of the TIMESTAMP column.

$query = "SELECT * FROM table_name WHERE DATE(date_column) = DATE(timestamp_column)";
$result = mysqli_query($connection, $query);

if(mysqli_num_rows($result) > 0) {
    while($row = mysqli_fetch_assoc($result)) {
        // Process the results
    }
} else {
    echo "No results found.";
}