PHP Database Table Editor v2.0

On various occasions, we want instant access to see or edit our database tables without having time to write a whole module with add, edit, delete, list, search (CRUD) operations. Whether your database is SQL Server, Oracle, DB2, MySQL or PGSQL — PHP Grid provides you easy solution that takes database credentials in config and provide table access in form of lightweight and rich featured PHP Grid. It will provide you complete functions within your existing application admin interface.

This lightweight, yet power-featured PHP Grid Database Editor is developed by very simple code OR we can say by just configuration. In main code logic, we simply passed the dropdown value of selected table in $g->table attribute, and that’s all!

$g = new jqgrid();
// set few params
$grid["caption"] = "Grid for '$tab'";
$grid["autowidth"] = true;
$g->set_options($grid);
// set database table for CRUD operations
$g->table = $tab;
// render grid
$out = $g->render("list1");

You can extend this code to incorporate Access Control (ACL), Exporting Data (PDF, CSV, XLS) and several other features to make a powerful tool. We omitted them to show the code simplicity. This demo is based on MySQL, but you can have same function for MS SQL Server, Oracle, PgSQL databases.

Changelog:

  • Updated CSS/JS files to use CDN
  • Option to hide first column
  • Selection of tables and fields for editing
  • Show/Hide particular fields in runtime
  • Bulk Editing data with multiselection
  • Grid Persistance (Column Resizing, Filters, Sort etc)

PHP Grid comes with free version and a licensed version. With Free version you can connect with others databases like MySQL, MS SQL Server, Oracle, PgSQL,DB2. Licensed version also supports many advance features which you can integrate in your application.

Complete code for this demo can be accessed from this link.

You can download and start saving your time now!

Releases:

v2.6 – June 08 2019
v2.0 – May 19 2016
v1.2 – Apr 25 2015
v1.0 – Apr 8 2014

Multiple Files Uploading

Now PHP Grid support multiple file upload option. You can multi-select the files as in screenshot and upload to server.

multi-upload-1 Files are uploaded in specified folder and file names are saved as comma separated value in file type field.

multi-upload-2

Active licensed customers can get latest build + demo which supports it.
Contact us at gridphp@gmail.com

Firebird & SQLite Database Editor Support

We recently added support for Firebird & SQLite Databases. These fast, slick and reliable databases will help in running portable apps with PHP Grid. Thanks to PDO library, it’s integration is very with little configuration changes.

sqlite370_banner

// Database config for SQLite
$db_conf = array();
$db_conf["type"] = "pdo";
$db_conf["server"] = "sqlite:../../sampledb/northwind.sqlite";
$db_conf["user"] = "";
$db_conf["password"] = "";
$db_conf["database"] = "";
$g = new jqgrid($db_conf);

 

firebird

// Database config for Firebird
$db_conf = array();
$db_conf["type"] = "pdo";
$db_conf["server"] = "firebird:host=localhost;dbname=C:/sampledb/employee.fdb";
$db_conf["user"] = "SYSDBA";
$db_conf["password"] = "masterkey";
$db_conf["database"] = "";
$g = new jqgrid($db_conf);

Working demo code: http://www.phpgrid.org/demo/demos/loading/db-layer-firebird.phps

You will need to change database credentials and update tables/columns configuration as desired. Refer docs for help.

Licensed customers can request free upgrade using update link.
To download free license, visit download page.
To purchase license, you can visit this link.

Search with Multiple Group Conditions

Hello,

We’ve added most robust and efficient complex searching method in PHPGrid.

This enables the more advanced search dialog allowing to add any number of complex group conditions. The user can now add or delete an unlimited number of conditions to perform the search as shown in screenshot.

search-group

This will formulate following search query, “( … )” refers groups in search query:

(name LIKE "%An%" OR company LIKE "%Mar%") 
AND 
(name LIKE "%Fa%" OR company LIKE "%Far%") 
AND 
gender = "male" AND client_id < 25

Hope you like this feature. Customers with active subscription can get latest build + demo via email.
We also offer discounted renewal prices for customers with expired subscription.
For any case, contact on our support team at (gridphp@gmail.com).

Exporting selected Columns & Rows (at Runtime)

Now you can export selected rows and columns at runtime. This means no code change, Export selection options are now on accessible with grid operations toolbar.

Demo: http://phpgrid.org/demo/demos/export/export-selected.php

In demo, select columns using column chooser and rows by multiselect option, then click Export selected button. This will export PDF of selected rows/cols. As the grid exports PDF format, the data table can be printed by your favorite PDF reader.

Export selected Columns and Rows

Enhanced Autocomplete (Typeahead) Integration

We’ve further enhanced PHP Grid and JQuery UI Autocomplete integration.
Types and Steps shows how to integrate database driven type ahead / autocomplete by lookup sql query.

1) Basic Typeahead (single field)

Step1: Set formatter to autocomplete on desired column

$col["formatter"] = "autocomplete"; // autocomplete

Step2: Set format options query. The field in sql aliased ‘v’ will be shown in list

// Fill the name field with query values typeahead
$col["formatoptions"] = array(	"sql"=>"SELECT name as v FROM clients", "update_field"=>"name");

2) Autofill other field.

The field ‘company’ will be filled w.r.t. selected name.

$col["formatoptions"] = array(	"sql"=>"SELECT company as k, name as v FROM clients","update_field"=>"company");

The field aliased ‘k’ will be set in the ‘updated_field’ column (e.g. company)

3) Callback function

Connect a callback function that will auto-fill multiple fields.

$col["formatoptions"] = array(	"sql"=>"SELECT *, name as v FROM clients", "callback"=>"fill_form");

and in html part, define callback JS function.

<script>
function fill_form(data)
{
    jQuery("input[name=gender].FormElement").val(data.gender);
    jQuery("textarea[name=company].FormElement").val(data.company);

    jQuery("input[name=gender].editable").val(data.gender);
    jQuery("textarea[name=company].editable").val(data.company);
}
</script>

References: Sample Code and Live demo

Active license subscription OR those who wish to renew subscription can get updated build by contacting via email (gridphp@gmail.com).