Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP PHP & Databases with PDO Getting Started With PDO Introductions

Chris Grazioli
Chris Grazioli
31,225 Points

Can't get sqlite to work properly in Workspaces - Connecting with PDO

Last login: Mon Nov 2 21:36:33 UTC 2015 on pts/0
treehouse:~/workspace$ sqlite3
SQLite version 3.7.17 2013-05-20 00:56:22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .databases
seq name file


0 main
sqlite> .database.db
Error: unknown command or invalid arguments: "database.db". Enter ".help" for help

I followed the video (exactly?) on the console, but I keep getting the error mention... going any further with any other commands yields an unresponsive prompt "...>" that will not do anything.

I opened Workspaces and the files appear to all be there. There is an index.php, database.db, database.php.

I have seen other help topics that point towards different versions of sqlite3 being the culprit, but they don't make much sense... Any one having the same experience

2 Answers

Jose Soto
Jose Soto
23,407 Points

Instead of using two separate commands sqlite3 and then .database.db, try using sqlite3 database.db

treehouse:~/workspace$ sqlite3 database.db                                                                                                                                                                   
SQLite version 3.7.17 2013-05-20 00:56:22                                                                                                                                                                    
Enter ".help" for instructions                                                                                                                                                                               
Enter SQL statements terminated with a ";"                                                                                                                                                                   
sqlite> .databases                                                                                                                                                                                           
seq  name             file                                                                                                                                                                                   
---  ---------------  ----------------------------------------------------------                                                                                                                             
0    main             /home/treehouse/workspace/database.db
Chris Grazioli
Chris Grazioli
31,225 Points

I can get .databases to run, but there is no file name in the right hand column for the 0,main

Chris Grazioli
Chris Grazioli
31,225 Points

That's a no-go, and thats not what they did in the video?