How does PHP handle the presence or absence of a semicolon at the end of a MySQL query?

When executing MySQL queries in PHP, it is important to end each query with a semicolon. If a semicolon is missing at the end of a query, PHP may not execute the query properly, leading to errors or unexpected behavior. To ensure that queries are executed correctly, always remember to include a semicolon at the end of each query.

$query = "SELECT * FROM users;"; // Make sure to end the query with a semicolon
$result = mysqli_query($connection, $query);