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

Subscribe to our news:
Partners
Testimonials
Grey: "We're a two-person company, it's just me an my wife. I'm the technical guru, and she handles the business operations. I have to know a lot about MySQL, but that's much too technical for her. I have frequently had to setup CGI scripts (I code in Perl) so she can manage some of our tables (suppliers, manufacturers, etc).

I discovered PHP Generator a couple of days ago, tried the free version,and within a few hours I had purchased the Pro version (as well as SQL Maestro for MySQL).

Today I am completing the conversion of the last of my custom table managers to PHP Generator. This is eliminating several thousand lines of code that I don't have to support any more!

Thanks for this fantastic product".

Steve Morton: "First let me thank you for making this application Free. Best deal I have ever see for what it does".

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