What potential formatting errors could cause the PHP code to not output the text after checking if $num_rows == 0?

The potential formatting errors that could cause the PHP code to not output the text after checking if $num_rows == 0 include missing or incorrect syntax, improper use of curly braces, or a misplaced semicolon. To solve this issue, ensure that the if statement is correctly formatted with proper syntax and curly braces. Additionally, check for any misplaced semicolons that could terminate the statement prematurely.

// Check if $num_rows is equal to 0 and output text if true
if ($num_rows == 0) {
    echo "No results found.";
}