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 PDO Queries & Results Queries with PDO

Exequiel R.
PLUS
Exequiel R.
Courses Plus Student 16,828 Points

Every time I try to misname the DB Sqlite create a new one with the wrong name ΒΏWhat can I do to solve that?

I'm working on the Workspace and every time I try to misname the DB as you did on the video to check the error handling Sqlite creates a new one, I don't know if this has happened to anyone else. I'm having the same issue on my terminal, I think its a Sqlite thing but I don't know why did Hampton managed to make it work.

2 Answers

Tomasz Budny
Tomasz Budny
14,588 Points

The point of this exercise to catch an error. Just make a different syntax error e.g.

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

Exequiel R.
Exequiel R.
Courses Plus Student 16,828 Points

Thanks for the answer Tomasz, I understood the point of the exercise but I couldn't catch the error I think I wasn't misnaming the "sqlite" part. Pretty stupid mistake. Thanks for your help anyway.

Stephanie van Doleweerd
Stephanie van Doleweerd
3,075 Points

Thanks for asking about this. I was going nuts trying to get my connection to fail and couldn't.