Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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

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

IMAGE: http://gyazo.com/ad4514f78cc3f9edd6789b699d2f1c08

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,989 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.

http://php.net/manual/en/function.error-reporting.php