How can error reporting be enabled in PHP to identify syntax errors or issues with queries?

Error reporting in PHP can be enabled by setting the error_reporting directive in the php.ini file to E_ALL. This will display all types of errors, including syntax errors and issues with queries. Additionally, you can use the error_reporting() function in your PHP script to dynamically set the error reporting level.

// Enable error reporting
error_reporting(E_ALL);