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

Subscribe to our news:
Partners
Testimonials
Ananda Theerthan J: "I have been looking for PHP generator for years and now I am happy that I found one. Yes, its the PHP generator for MySQL. I completely rate 10/10 for this product for making life easier. It has lot of features and capabilities especially the CRUD, lookups and data partitioning. I love this product and recommend to others".
Lucian Nedescu: "Thank you very much. Have a nice century (this is a real wish :P). I think that i will do a great job on my clients database with the new php interface. Thank You again".

More

Add your opinion

PHP Generator for MySQL online Help

Prev Return to chapter overview Next

OnPageLoaded

This event occurs after the page is completely loaded from the server. It allows you, for example, to add additional filters to the dataset.

 

Signature:

function OnPageLoaded()

 

Parameters:

This method has no parameters.

 

Example 1

The following code is used in our Schema Browser Demo to filter database objects belonging to the selected database:

 

applyDatasetFilter($this->dataset);

 

Here applyDatasetFilter() is a function defined in the schema_browser_utils.php file as follows:

 

function applyDatasetFilter(Dataset $dataset) {

    if (GetApplication()->IsGETValueSet('database'))

        $value = GetApplication()->GetGETValue('database');

    else

        $value = ArrayUtils::GetArrayValueDef($_COOKIE, 'database');

    if (StringUtils::IsNullOrEmpty($value)) {

        $globalConnectionOptions = GetGlobalConnectionOptions();

        $value = $globalConnectionOptions['database'];

    }

    if (!StringUtils::IsNullOrEmpty($value)) {

        $dataset->AddFieldFilter('Database_name', new FieldFilter($value, '='));

        setcookie('database', $value);

    }

}

 

Example 2

The following code is used in our Feature Demo to filter countries according to the values selected in the form:

 

// default values

$minLifeExpectancy = 40;

$maxLifeExpectancy = 90;

 

// checking values in the browser address line 

if (GetApplication()->isGetValueSet('minLifeExpectancy') &&

       GetApplication()->isGetValueSet('maxLifeExpectancy')) {

    $minLifeExpectancy = GetApplication()->GetGETValue('minLifeExpectancy');

    $maxLifeExpectancy = GetApplication()->GetGETValue('maxLifeExpectancy');

 

// or (if not found) in the session

} else if (isset($_SESSION['minLifeExpectancy']) && 

           isset($_SESSION['maxLifeExpectancy'])) {

    $minLifeExpectancy = $_SESSION['minLifeExpectancy'];

    $maxLifeExpectancy = $_SESSION['maxLifeExpectancy'];

}

 

// saving calculated values to the session

$_SESSION['minLifeExpectancy'] = $minLifeExpectancy;

$_SESSION['maxLifeExpectancy'] = $maxLifeExpectancy;

 

// applying filter to the dataset

$this->dataset->AddCustomCondition(

    "life_expectancy >= {$minLifeExpectancy} ".

    "AND life_expectancy <= {$maxLifeExpectancy}");

 

See also: OnPreparePage.



Prev Return to chapter overview Next