PHP Using PHP with MySQL Querying the Database with PHP Avoiding Duplication

Why is this message also displayed when I test the error code?


Randy does not get that Warning message (line 1) when the connection to the MySQL database fails. Instead, he only gets the error message that he echoes out in the catch (line 2).

Is that because he's on iOS?

Maybe your have error reporting enabled by default (i can't recall if xampp make it enabled by default or not since i'm not using it anymore).

Try to disable it within your php.ini file and the error will disappear.

Note: to keep it enabled is highly recommended for debugging purposes.

Logan R
Logan R
22,911 Points

Can you please post your code?

It may be as Muhammad said, your error reporting is set higher than his.

You can change the php.ini file or use PHP's error_reporting Command.