SQLite Edit for PHP

SQLite Edit for PHP is a web-based admin tool for managing your SQLite databases that you can use to give your users the ability to view, edit and update the data without the danger of them destroying the database.

Introduction

SQLite Edit for PHP is a Free and Open Source web-based admin tool for making interfaces to your SQLite database tables. It's not a full database admin tool however. You cannot use it to add, modify or delete tables, views etc. You wouldn't give such a tool to your users, allowing them to destroy your database! It's a tool that allows the addition, editing and deletion of data in existing tables. Adding, editing and deletion can all be enabled or disabled so you can turn them all off and just allow viewing the data if you wish.

It can be easily integrated into your pages - as you can see from the example below. It's just a single library file which makes it simple to setup and go.

What about the phpSQLiteAdmin application?

SQLite Edit for PHP cannot be used for database administration tasks. It has no facilities to add, edit or delete tables, indexes or views etc. Read more in the FAQs here.

Features

SQLite Edit for PHP is a flexible piece of software that can handle many use cases.

✓ Define your own SQL queries instead of the defaults for selecting, inserting, deleting and updating rows. For example, you might want to exclude rows that have a "deleted" flag set.
✓ Editing of rows with various form controls including simple text inputs, file upload inputs, select dropdowns, radio buttons, checkboxes and most (if not all) of the newer HTML5 inputs (for example slider bars). Custom save URLs can be given to handle the saving of the updated data yourself if required.
✓ The file upload support allows you to upload files from your computer and then either store them in the database or on the filesystem.
✓ Custom column names instead of the database column names if preferred.
✓ Custom column widths.
✓ Different callback functions can be given for each column allowing you to customise the output to your needs (for example formatting a date column to be more human readable).
✓ Events are fired for add/edit/delete actions allowing you to run your own functions when such an event occurs.
✓ Columns can be fully escaped or you can allow HTML in columns (for example, to show images or text formatting).
✓ Customisable number of rows shown at once with paging controls shown at the top-right of the grid (as you can see from the example below).
✓ A quick and comprehensive search function using the SQLite GLOB syntax (which is similar to regular expression syntax and allows for wildcard searches).
✓ The results can be ordered by the user by clicking the column headers. Columns can be included or excluded from ordering or you can disable ordering completely. Ordering can be case sensitive or not as you see fit.
✓ The grid can be fully styled using CSS. This CSS can be specified within the configuration if you wish or you can just put it in your own CSS file.
✓ HTML buttons (or any HTML) can be placed underneath the grid or on the right of each row. For example, you could have a select dropdown on the right of each row that contains various actions that you want to provide to your users.
✓ Checkboxes or radio buttons (or neither!) can be placed on the left side of each row.

Example

⮾ ⚲
  help
Displaying 1 - 7 of 25 results
◀  1  2  3  4  ▶
ID
Username
Created
Forename
Surname
4129
jokovitche
2026-06-12
Erin
Jokovitch
4140
jerrym
2026-07-01
Jerry
Malkovitch
4141
andrewo
2026-067-31
Andrew
Osbod
12345
heyesr
2000-01-01
Richard
Dole
41031
johnd
2026-10-11
John
Digford
41087
kevinp
2001-01-01
Kevin
Peterson
41088
luisk
2005-12-31
Luis
Kapaldi
 (add/edit/delete are disabled on this demo)

And here's the source-code that produces the editor above.

<?php
    $editor = new SQLiteEdit([
        'filename'     => 'examples/sqliteedit.db',
        'table'        => 'accounts',
        'sql_select'   => "SELECT id,
                                  username,
                                  created,
                                  forename,
                                  surname
                             FROM accounts
                            WHERE {where}
                                  {order}",
        'sql_insert' => false,
        'sql_delete' => false,
        'paging_perpage' => 7,
        'columns_names' => [
            'id'       => 'ID',
            'username' => 'Username',
            'created'  => 'Created',
            'forename' => 'Forename',
            'surname'  => 'Surname'
        ],
        'style' => [
            'div.editor table {line-height: 25px;}',
            'div.editor table th {text-align: center;}',
            'div.editor table tbody tr:hover {background-color: #eee;}',
            'div.editor table {width: 100% !important;}'
        ],
        'actions' => [
            '<small><i>(add/edit/delete are disabled on this demo)</i></small>'
        ],
        'search_callback' =>function ($obj, $columns, &$terms)
        {
            foreach ($terms as &$t) {
                if (   in_array($t, ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december','jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'])) {
                    $t = date('-m-', strtotime($t));
                }
            }
        }
    ]);
    
    $editor->draw();
?>

Download

This is the latest zip file download that contains the PHP file (it's just a single file) and the example pages. Extract this zip file to a directory on to your (PHP enabled) web server and all of the examples should run without any further modification or configuration.

Download the SQLite Edit for PHP zip file

Just want the source code?

If you just want the source code - get that using the link below. It's just a single file so you can copy it into your source tree and run it straight away. For the examples of how to use it you'll need the full source archive linked above.

Download just the SQLite Edit for PHP source code

 

Last updated: 11th October 2026