How does a MySQL OR statement work in PHP?

When using a MySQL OR statement in PHP, you can combine multiple conditions in a query to retrieve rows that meet any of the specified conditions. This allows you to retrieve data that meets at least one of the conditions specified in the OR statement.

// Example of using OR statement in MySQL query in PHP
$query = "SELECT * FROM table_name WHERE condition1 OR condition2";
$result = mysqli_query($connection, $query);

// Loop through the results
while ($row = mysqli_fetch_assoc($result)) {
    // Process the data
}