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

Subscribe to our news:
Partners
Testimonials
David Lantz: "Thank you, this is by far the simplest, and most friendly utility for building db record system I have ever used. I wish I could get my systems guys at the office to purchase this for our company would be so very helpful and speed up a lot of work. I for one have used it for everything from a simple inventory record of my house, to a members record for my church just little pet projects and a test bed to test my own db builds and theories before having to hand code at the office..... it is a lot of fun to work with".
Jonathan Oakes: "This is a lovely application. It's easy to hook into my own bespoke applications. It's very powerful, yet really quite simple to use. Thanks for this".

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