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 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?