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

Subscribe to our news:
Partners
Testimonials
Mike Little: "Great product, thank you for your great work and sharing".
Philipp Gerber: "

The product is so easy and super built that you can achieve visible and great success after a short time. Also very much possible with the product. A class product. I'm already looking forward to the next versions and extensions. Keep it up.

Support to the product is just perfect. Each Support request is quickly and very competent solved. Also various assistance, which does not fall into a support, are also perfectly processed. There is a direct wire to the manufacturer / developer and this is notth. Thanks for the class Support".

More

Add your opinion

PHP Generator for MySQL online Help

Prev Return to chapter overview Next

Using Variables

PHP Generator for MySQL supports:

some environment variables (such as CURRENT_USER_ID, CURRENT_USER_NAME, UNIQUE_ID) in both page and application level server-side events.
custom environment variables to be used in any server-side event of the concrete page (specified within the OnAddEnvironmentVariables event handler) and in any server-side event of any application page (specified within the global OnAddEnvironmentVariables event handler). Such variables can also be used in lookup filter criteria, on data filtering, and as default values.

 

Retrieving the list of available variables

To obtain a complete list of supported variables, turn ON the "Show environment variables" option in the Project Options dialog, re-generate the code and then open any of produced web pages in the browser.

 

 

Accessing variable value

To access the value of a variable, use the GetEnvVar method of the Page class.

 

Example 1

The following example demonstrates how to use variables within the OnBeforeInsertRecord event handler.

 

$rowData['ip_address'] = $page->GetEnvVar('REMOTE_ADDR');

$userName = $page->GetEnvVar('CURRENT_USER_NAME');

if ($userName != 'admin')

    $rowData['changed_by'] = $userName;

 

Within server-side page-level events it is also possible to use $this instead of $page.

 

Example 2

The following code used in the OnAddEnvironmentVariables event handler defines a new variable, which can be used in lookup filter criteria, on data filtering, as a default value, and also in any server-side event.

 



Prev Return to chapter overview Next