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

Subscribe to our news:
Partners
Testimonials
Simon Greener: "A lot of work went in to designing our application database. PHP Generator allowed us to build a fully functional, professional looking, and functionally powerful web application from that database. It has freed us from worrying about low level code, enabling us to focus on the business requirements of the customer. The support provided is excellent with staff quickly producing answers to questions ranging from newbie to simple or complex. I highly recommend the product".
Roger Brown: "Great product. The more I work with it, the more I am amazed at what it can do".

More

Add your opinion

PostgreSQL PHP Generator online Help

Prev Return to chapter overview Next

OnBeforeUpdateRecord

This event occurs when the Update command is executed, and before the actual update.

 

Signature:

function OnBeforeUpdateRecord ($page, $oldRowData, &$rowData, &$cancel,  &$message, 

       &$messageDisplayTime, $tableName)

 

Parameters:

$page

An instance of the Page class declared in components/page.php.

$oldRowData

The associative array of old (previous) values of the currently processed row.

$rowData

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

$cancel

The value indicating whether the operation should be canceled.

$message

The message string that is displayed after the operation is completed (or canceled).

$messageDisplayTime

A time interval (in seconds) after which the message will disappear automatically. Default value is 0 (the message will not disappear).

$tableName

The name of processed table.

 

Example 1:

if (!(allowDataEditing())) {

       $cancel = true;

       $message = 'The application is running in read-only mode.';

}

 

Example 2:

The following code allows to assign values to some fields (usually these fields are not included in an edit form)

before updating of a record:

 

$rowData['line_total'] = $rowData['quantity'] * $rowData['unit_price'];

$rowData['update_datetime'] = SMDateTime::Now();

$rowData['last_updated_by'] = $page->GetCurrentUserId();

 

See also: OnBeforeDeleteRecord, OnBeforeInsertRecord, OnAfterUpdateRecord.



Prev Return to chapter overview Next