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

Subscribe to our news:
Partners
Testimonials
Simon Greener: "A lot of work went in to designing our application database. PHP Generator allowed us to build a fully functional, professional looking, and functionally powerful web application from that database. It has freed us from worrying about low level code, enabling us to focus on the business requirements of the customer. The support provided is excellent with staff quickly producing answers to questions ranging from newbie to simple or complex. I highly recommend the product".
Olivier Auverlot: "At my work (a universitary computer research laboratory), I'm alone to create all applications and databases. I don't know how I could do all the work without it. It's really a very productive software. I can focus on the database schemas and create quickly the user applications with a minimal amount of code to maintain".

More

Add your opinion

PostgreSQL PHP Generator online Help

Prev Return to chapter overview Next

Suggestions

Suggestions for the AutoComplete editor can be based either on a data source (in this case you need to specify the data source name, field name, and the sort order) or on a PHP function with the following signature:

 

function OnGetSuggestions($term, &$suggestions);

 

Parameters:

$term

Current input

$suggestions

Array of suggestions for the current input

 

Example

The following example from our Feature Demo demonstrates how it is possible to use the Google API to get the list of suggestions. Don't forget to replace XXX to your Google API Key.

 

$url = 'https://maps.googleapis.com/maps/api/place/queryautocomplete/json?key=%s&input=%s';

$key = 'XXX';

$sourceUrl = sprintf($url, $key, urlencode($term)); 

 

$contextOptions = array(

    "ssl" => array(

        "verify_peer" => false,

        "verify_peer_name" => false

    )

);

 

$json = file_get_contents($sourceUrl, false, stream_context_create($contextOptions));

$result = json_decode($json, true);

if ($result['status'] == 'OK') {

    foreach ($result['predictions'] as $prediction) {

        $suggestions[] = $prediction['description'];

    }

} elseif ($result['status'] == 'OVER_QUERY_LIMIT') {

    $suggestions[] = 'Query limit is exceeded';

}

 

Minimum input length

Use this option to specify minimal amount of symbols to start retrieving suggestions.

 

Number of values to display

Defines the maximum number of suggestions to be displayed in the drop-down list.

 



Prev Return to chapter overview Next