Are there any best practices or guidelines for using semicolons in MySQL queries within PHP code?

When using semicolons in MySQL queries within PHP code, it is important to remember that semicolons are used to terminate SQL statements, but they are not required when executing queries through PHP's MySQL functions. Including semicolons within the query string can cause syntax errors. To avoid this issue, simply omit the semicolon at the end of the query string when using functions like mysqli_query().

$query = "SELECT * FROM table_name";
$result = mysqli_query($connection, $query);