@2020,
Error: process stops, and tells you what you did wrong. Warning: process continues, and tells you what's wrong Exception: if error occurs, the code executes what you have in place (called an "exception handler") should such an exception occur.
In development (as opposed to "live for public viewing), I have:
1.) On top of all my PHP pages:
error_reporting(E_ALL); ini_set('display_errors', 1);
2.) In the non-public file above the public_html directory
mysqli_report(MYSQLI_REPORT_ALL|MYSQLI_REPORT_STRICT);
$db = mysqli_connect("localhost" , "username" , "pass" , "database");
(Never ever ever have your mysql credentials in your public www directory.... the day will come when PHP for whatever reason decides to stop working and everybody will get to see your credentials)
I didn't even notice mac_gyver did not capitalize his sentences, I'm here for info, not to be grammar police 😀
But from what I understand mac_gyver is saying (I'm the worst PHP person on this entire forum) is:
1.) turn all the errors on during testing, but MAKE SURE all error reporting is turned off when your site is live for the public.
2.) You can create exception handlers in your php/mysql code so you can debug specific parts of your code, if you want. Otherwise, Barand's #4 suggestion, combined with PHP error reporting on top of all your PHP pages should be sufficient (in most cases) to display most if not all the errors in your code.