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
not able to use command .open in treehouse console
Not able to use .open command in PHP and Databases with PDO workspace the error message is "unknown command or invalid arguments"
Sorry about the late reply. I tried it myself, and it seems to working great for me. Here are the steps I took:
- Create a new workspace using the PHP5 environment. (important)
- Create an
index.phpfile and paste in the code at the bottom of this answer.
- Create a file called
database.dbin the same folder as
- Either run
php index.phpin your console or click the eye icon in the upper-right corner of your workspace.
Hope that helps!
The code for
$db = new PDO("sqlite:./database.db");
I am having the same problem. I contacted the team at treehouse and it seems they expect the forum to solve a problem that is very likely on their side. I would like to be able to follow this tracks as intended :(
Scott Montgomery23,242 Points
Is there a solution for this yet?
Using .open in the sqlite3 console still gives the following error: Error: unknown command or invalid arguments: "open". Enter " .help" for help
I'm fairly confident that Treehouse has not included databases (and necessary extensions like PDO) with Workspaces, simply because of the amount of effort it would take.