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

Subscribe to our news:
Partners
Testimonials
Rickey Steinke: "Folks, I wanted to drop a line and give you a fanatic thank you. I have a project due for my computer application course and without PHP Generator I never would have gotten it done with the professional results your product produced. My sincerest gratitude to each and every team member who brought this program to light".
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

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