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;
// 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.
- 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!
v2.6 – June 08 2019
v2.0 – May 19 2016
v1.2 – Apr 25 2015
v1.0 – Apr 8 2014