Is there anyway to access sqlite packaged with PHP via command line?
Start the sqlite3 program by typing "sqlite3" at the command prompt, optionally followed by the name of the file that holds the SQLite database (or ZIP archive). If the named file does not exist, a new database file with the given name will be created automatically.
From the command-line, without using the php executable to execute a PHP script, you won't use the SQLite extension that's bundled with PHP.
But SQLite databases created from PHP are just standard SQLite databases (which are stored in a file), so they can be opened and manipulated with any existing SQLite client.
For example, from my Linux shell, I can use :
$ sqlite3 -header -column /home/squale/.../db/krypton-lite-scores.db
SQLite version 3.7.4
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> select * from highscores;
id name score latitude longitude timestamp
---------- ---------- ---------- ---------- ---------- ----------
1 Squale 20 45.7686 4.8128 1310533429
2 Squale 63 45.7682 4.8131 1310579495
3 Squale 42 45.7686 4.8127 1310586793
sqlite>
And this allows me to work with that SQLite database -- which is normally manipulated by some PHP scripts.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With