You are here

function hosting_client_autocomplete in Hosting 6.2

Same name and namespace in other branches
  1. 5 client/hosting_client.module \hosting_client_autocomplete()
  2. 7.4 client/hosting_client.module \hosting_client_autocomplete()
  3. 7.3 client/hosting_client.module \hosting_client_autocomplete()

Retrieve autocomplete suggestions.

1 string reference to 'hosting_client_autocomplete'
hosting_client_menu in client/hosting_client.module
Implementation of hook_menu().

File

client/hosting_client.module, line 932

Code

function hosting_client_autocomplete($type, $keyword) {
  $matches = array();
  if ($type == 'client') {
    $query = db_query(db_rewrite_sql("SELECT * FROM {node} n WHERE type = '%s' AND title LIKE '%s%%'"), $type, addcslashes($keyword, '\\%_'));
    while ($result = db_fetch_object($query)) {
      $matches[$result->title] = $result->title;
    }
  }
  drupal_json($matches);
  exit;
}