How to Create DataGridView in php with phpGrid

Datagridview | Phpgrid

datagridview in php


To Create DataGridView in PHP you need phpGrid. If you are new to phpGrid, we recommend that you go through the examples in the sequence provided for each section. First download phpGrid.

Before you begin, make sure that you have installed and configured phpGrid properly. phpGrid utilizes jQuery extensively, the popular cross-browser Javascript framework. The current phpGrid supports jQuery version 1.9.0.

If you are already using jQuery but a different version, considering removing the existing jQuery to avoid version conflicts. If you have questions regarding this, please send us an email.

Please note, certain features, such as update, delete, and add new are disabled in online demo for security reason.

datagridview in php

A Basic DataGridView in PHP

The basic datagridview in php requires only as little as TWO lines of code. Foremostly, always create phpGrid object in the first line; then call its methods to define properties, and lastly always call display() to render to screen.

Please note in some databases, such as Firebird, MS Access, the fields name are case-sensitive. Make sure the name used in the code matches the case when you are using those type of databases.

  • parameter 1: SQL statement
  • parameter 2: SQL primary key
  • parameter 3: SQl table name

 Descriptive Column Headers

By default phpGrid pulls out the data field name defined in database as the header for each column. You can simply change the title using method set_col_title().

 Hide Column

For columns need not to be shown, such as primary key, use method set_col_hidden() to hide those columns. To hide column in both datagridview and form, set the second parameter to false. This is useful to hide the auto increment primary key field from edit form.

Very Important:
The data are still sent to web browser but hidden using CSS display:none. For sensitive data such as passwords and SSN etc, do not use this method, instead do not include those fields in your SQL at all.

there are more options you can configure which is explained in documentation of phpGrid. If you find any difficulty configure phpGrid for more option please let us know by submit query in contact page. We are happy to help you. For more updates like our FB Page.

Bookmark Link using: bookmark at folkd

  • Dhayal Ram

    Heard about a new technology