Use of SQLite Manager to work with SQLite database

MV framework supports MySQL and SQLite databases. Below we represent a technology of working with SQLite database which is compact and quickly transferable from one server to another, and has all the features required for a modern DBMS.

MV works with SQLite through PDO library. It is included on the most of the servers, in case the database fails to launch due to the driver missing, here you can read more about it’s settings. SQLite stores all the information in one file "userfiles/database/sqlite/database.sqlite".

Firefox https://addons.mozilla.org/ru/firefox/addon/sqlite-manager/. This extension allows to work with database the same way as phpMyAdmin for MySQL.

After the extension is installed, you need to launch SQLite Manager and select the file of database type "userfiles/database/sqlite/database.sqlite". After connecting database file to SQLite Manager a list of table will appear in the left column.

To create a new table, click on the top screen menu, select Table -> Create Table, after that a window will pop up to enter table fields.

To get to the newly created created table, just click on the name of the table in left column. In top tabs you can view the structure of table and list of table records.

Double click the record of the table to bring up a dialog box to edit record values.

In general, the work with SQLite Manager is not much different from work with phpMyAdmin for MySQL. Also you can manage table and indexes, perform direct queries and create triggers. The whole process occurs within one file, which then will be copied from a local server to the working one. Though, it is important to specify "write" rights for the database file and the folder where it is located. Depending on configuration the rights could be as 777, 770, 775 and others.

Setting of PDO SQLite

If PDO driver for SQLite is included, then upon phpinfo() function call you can see the information about driver’s version. If there is no such an information, it means, the drivers was not included and it should be turned on in the settings of PHP.

PDO SQLite

There should be the following files in library (extensions) folder of PHP: php_pdo_sqlite.dll and php_sqlite3.dll.

PHP library for SQLite

In php.ini file uncomment the lines to include these libraries, after that restart the web server.

Editing php.ini for PDO SQLite

After webserver restart an information about PDO driver include for SQLite will appear in phpinfo() as shown on the screenshot above.