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

Subscribe to our news:
Partners
Testimonials
Patrick Biegel: "Thanks a lot for your fast reply and the great solution! It works now and that's really important! The PHP Generator for MySQL is a great software".
Charles Phillips: "Just want to take a second to really thank you for all the great support you give – I think that’s by far the best feature you offer".

More

Add your opinion

PHP Generator for MySQL online Help

Prev Return to chapter overview Next

OnGetFieldValue

This event occurs on displaying a value of a field. It allows you to replace the actual value of a field to your own.

 

Signature:

function OnGetFieldValue ($fieldName, &$value, $tableName)

 

Parameters:

$fieldName

The name of currently processed field.

$value

The actual value of the field. Can be changed to another value.

$tableName

The name of currently processed table.

 

Example

This example shows how this event can be used for implementing a very simple transparent encryption based on the str_rot13 PHP function.

 

if ($fieldName == 'private_data') {

    $value = str_rot13($value);

}

 

Since the call of this function for an encrypted expression returns the original string, we can define OnBeforeInsertRecord and OnBeforeUpdateRecord event handlers as follows:

 

$rowData['private_data'] = str_rot13($rowData['private_data']);

 

This is just an example. We would recommend that you use more cryptographically strong algorithms to encrypt your important data.



Prev Return to chapter overview Next