PHPackages                             datatables.net/editor-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. datatables.net/editor-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

datatables.net/editor-php
=========================

PHP server-side libraries for DataTables

2.5.2(7mo ago)36234.3k—1.1%26[6 issues](https://github.com/DataTables/PHP/issues)[1 PRs](https://github.com/DataTables/PHP/pulls)MITPHPPHP &gt;=5.4.0 &lt;9CI passing

Since Oct 4Pushed today8 watchersCompare

[ Source](https://github.com/DataTables/PHP)[ Packagist](https://packagist.org/packages/datatables.net/editor-php)[ Docs](https://editor.datatables.net)[ RSS](/packages/datatablesnet-editor-php/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (4)Versions (42)Used By (0)

DataTables PHP server-side libraries
====================================

[](#datatables-php-server-side-libraries)

This is a PHP library to provide easy server-side support for [DataTables](https://datatables.net/) - *the* Javascript table library.

These libraries provide support for:

- Server-side processing - work with millions of rows
- [Editor](https://datatables.net/manual/extensions/editor) - Editing UI for DataTables
- ColumnControl - Column search controls for DataTables
- SearchBuilder - Complex search logic UI

The library is framework-agnostic and can be used in any web framework, including Laravel, Symfony and CodeIgniter. It is dependency free, other than PHP core with PDO, and uses a database abstraction layer to operate with MySQL, Postgres, SQLite and SQLServer, using the same API.

Installation
------------

[](#installation)

Available on [Packagist](https://packagist.org/packages/datatables.net/php), this package can be installed with:

```
composer require datatables.net/php
```

Then add:

```
require 'vendor/autoload.php'
```

to your files that use the DataTables classes. The required classes will be automatically included as you use them.

If you prefer not to use composer and include the PHP files directly, download them and require the `DataTables.php` file, which will load the auto loader for the classes:

```
require( $_SERVER['DOCUMENT_ROOT'] . 'lib/DataTables.php' );
```

### Database connection

[](#database-connection)

You must create a database connection using the `Database` class. This can be done automatically by defining the array `$sql_details` in `config.php`, or creating a `new Database()` class instance directly:

```
$db = new Database( [
	'type' => '',  // Database type: "Mysql", "Postgres", "Sqlserver", "Sqlite"
	'user' => '',  // Database user name
	'pass' => '',  // Database password
	'host' => '',  // Database host
	'port' => '',  // Database connection port (can be left empty for default)
	'db' => ''    // Database name
]);
```

There are two primary entry point classes in the library:

- `DataTable` - for read only tables
- `Editor` - for read / write tables, with [Editor](https://editor.datatables.net/)

There are also a number of supporting classes such as `Options`, `Mjoin` and more.

Quick Start
-----------

[](#quick-start)

Once a database connection is configured, you can use the library to read and write data on a database - e.g. the following is a simple PHP file that acts as a CRUD end point for for a DataTables / Editor client-side:

```
