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 CRUD Operations with PHP Project Setup Connecting to the Database

PHP results not showing in console

I am on the first video of using CRUD with PHP. Trying to do a var_dump and connect to the database. My console is not showing any results. Any ideas why?

Algirdas Lalys
Algirdas Lalys
9,389 Points


Could you paste your code, it's difficult to say what is wrong:)

Hi Algirdas Lalys,

Thanks for your help. Unless I am missing a syntax, I have typed exactly what is in the video at https://teamtreehouse.com/library/connecting-to-the-database-2

Here is my code:


$db = new PDO("sqlite:".DIR."/database.db"); var_dump($db);

Sorry....figured it out. Thought Workspaces would do automatic saves. Clicked "File/Save" and works perfectly.

Algirdas Lalys
Algirdas Lalys
9,389 Points

Cool you have figured it out:) Well done. Yap in workspaces you do have to save. You can use keyboard shortcut as well (CTRL + S)