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

Subscribe to our news:
Partners
Testimonials
Javlon: "Beautifully done. This is a stunning software,it creates the pages in no time. Thank you for your hard efforts in creating this software".
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".

More

Add your opinion

PHP Generator for MySQL online Help

Prev Return to chapter overview Next

OnAfterUpdateRecord

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

 

Signature:

function OnAfterUpdateRecord ($page, $oldRowData, $rowData, $tableName, 

       &$success, &$message, &$messageDisplayTime)

 

Parameters:

$page

An instance of the Page class.

$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.

$tableName

The name of processed table.

$success

Indicates whether the last data manipulation statement was successful or not.

$message

A message to be displayed to a user. If the statement completed successfully, the value of this parameter is equal to empty string. If the statement failed, the value of this parameter contains the error message that came from the database server.

$messageDisplayTime

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

 

Success messages are displayed in green while error messages are displayed in red.

 

Example 1:

if ($success) {

    $message = 'Record processed successfully.';

}

else {

    $message = '<p>Something wrong happened. ' .

        '<a class="alert-link" href="mailto:admin@example.com">' .

        'Contact developers</a> for more info.</p>';

}

 

Example 2:

The following code logs information about modified records into a separate table:

 

if ($success) {

  // Check if record data was modified

  $dataMofified  = 

    $oldRowData['first_name'] !== $rowData['first_name'] ||

    $oldRowData['last_name'] !== $rowData['last_name'] ||

    $oldRowData['email'] !== $rowData['email'];

 

  if ($dataMofified) {

    $userId = $page->GetCurrentUserId();    

    $currentDateTime = SMDateTime::Now();

    $sql = 

      "INSERT INTO activity_log (table_name, action, user_id, log_time) " .

      "VALUES ('$tableName', 'UPDATE', $userId, '$currentDateTime');";

    $page->GetConnection()->ExecSQL($sql);  

  }                                    

}

 

Example 3:

The following code is used in our Feature Demo to modifty genres of the updated movie to a separate table:

 

if ($success && GetApplication()->IsPOSTValueSet('genres')) {

  $sql = sprintf('DELETE FROM movie_genres WHERE movie_id = %d;', $rowData['id']);

  $page->GetConnection()->ExecSQL($sql);

  $genres = GetApplication()->GetPOSTValue('genres');

  foreach ($genres as $genre) {

    $sql = sprintf('INSERT INTO movie_genres VALUES(%d, %d);', $rowData['id'], $genre);

    $page->GetConnection()->ExecSQL($sql);

  }

}

 

See also: OnAfterDeleteRecord, OnAfterInsertRecord, OnBeforeUpdateRecord.



Prev Return to chapter overview Next