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".
Dave Lantz: "I have to say that I simple love this product and its ease of use. I know that I have only tapped into about 20% of what it can do. In my business I come into a lot of contact with developers and I tell them all, that if they need an easy way to connect, report or work their databases they MUST check out your products".

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.

 

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

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.

 



Prev Return to chapter overview Next