Choose your database:
AnySQL
MySQL
MS SQL Server
PostgreSQL
SQLite
Firebird
Oracle
SQL Anywhere
DB2
MaxDB

Subscribe to our news:
Partners
Testimonials
Peter Robinson: "As a tech savvy company director, I wanted an inexpensive web based database application to manage all aspects of my business. As with most humans I find developing purely by CLI very hard and do not have the will or time to invest in improving my skills. I was looking to find a nice human friendly GUI to design and build my application, which is when I came across PHP Generator for MySQL.

Whilst you still need a great understanding of logic and a small amount of programming ability to get the specific results you require, I am very happy with the speed of progress I have been making with this invaluable tool.

With all the standard libraries included, this product makes normal requirements such as JavaScript form validation, lookup selectors, on click events, auto complete, detailed searches, multiformat exports, rss feeds and username security straight forward and quick.

Having any changes made via the GUI written to the web server at the click of a button makes testing out ideas quick and easy without fear of breaking your application.

To conclude, I couldn't find any other product on the market that came close to offering the amount of options this does, and I do hope that more products like this come out in the future, with the hope of eventually eradicating the need to program all together".

Steve Morton: "First let me thank you for making this application Free. Best deal I have ever see for what it does".

More

Add your opinion

PHP Generator for MySQL online Help

Prev Return to chapter overview Next

OnCustomRenderColumn

This event occurs before column rendering and allows you to completely replace the cell content. It is an extremely useful event for conditional rendering or embedding third-party components to extend standard functionality.

 

Signature:

function OnCustomRenderColumn ($fieldName, $fieldData, $rowData, 

    &$customText, &$handled)

 

Parameters:

$fieldName

The field name for the currently processed cell.

$fieldData

The data of currently processed cell.

$rowData

The associative array of values that corresponds to the currently processed row.

$customText

A string to replace the original cell content.

$handled

A parameter to indicate whether the event handler takes effect. Set $handled to true to apply the new content.

 

Example 1:

Suppose a table 'employee' has a column storing data about the employee's sex in that way that '1' corresponds to male and '2' to female. Our goal is to represent the employees sex as 'M' and 'F' for men and women accordingly. To do so, you could specify the OnCustomRenderColumn event handler as follows:

 

if ($fieldName == 'sex') {

  $customText = $rowData['sex'] == 1 ? 'M' : 'F';

  $handled = true;

}

 

Example 2:

The code below is used in our demo project to show the number of overtime periods played in the game.

 

if ($fieldName == 'overtime_count') {

    if ($fieldData > 0)

        $customText = $fieldData . ' OT';

    else

        $customText = '-';

    $handled = true;   

}

 

The screenshot demonstrates the result of this event fired on the Games webpage.

 

Example 3:

The code below is used in our demo project to add flag images to the "Country" column.

 

if ($fieldName == 'current_team_id')

{

  if (!isset($fieldData))

  {

     $customText = 'Free agent';

     $handled = true;

  }

}

elseif ($fieldName == 'country_id')

{

  $countriesPics = array ( 

    1 => 'us', 

    2 => 'fr', 

    3 => 'br', 

    4 => 'it', 

    6 => 'sp',

    8 => 'ar',

    11 => 'li',

    15 => 'ru',

    18 => 'gr',

    20 => 'ge'

  );

  $customText = 

    '<div style="width: 80px; text-align: left;">' .

      '<img src="countries/'.$countriesPics[$rowData['country_id']].'.png">' .

      '&nbsp;' . $fieldData .

    '</div>';  

  $handled = true; 

}

 

Example 4

This example demonstrates the applying of the syntax highlighting provided by the Geshi library. We use this library to highlight SQL syntax in strings stored in the 'Body' column.

 

if ($fieldName == 'Body') {

    $source = $rowData['Body']; 

    $language = 'sql';

    $formatted_sql = SqlFormatter::format($source, false);

    $geshi = new GeSHi($formatted_sql, $language);

    $customText = '<div align="left">'.$geshi->parse_code().'</div>';

    $handled = true;

}

 

See also: OnCustomRenderPrintColumn, OnCustomRenderExportColumn



Prev Return to chapter overview Next