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 PHP & Databases with PDO Getting Started With PDO Managing Errors

My database works even if I spells it wrong. Who can help me? https://w.trhou.se/h6x7yjemq1

The strange part is that the database works even if I spells it wrong. So it wong catch it from at try catch block. Who can help me?

https://w.trhou.se/h6x7yjemq1

3 Answers

Workspace seems to create a new database file automatically when we misspell the file name. I had to refresh the file view to see this. Using another syntax error will display the error block. Such as,

$db = new PDO('ssssqlite:./database.db');

Thank you for this Karalyn!

True! Thx Karalyn!

I can see it is copying the database. Maybe we have an error in the system. What do you people think?

Hi Sajid,

There's probably a setting that the teacher made on his computer that we haven't made that makes our exact same code behave differently.