topical media & game development

talk show tell print

server-webapi-code-06-nusoap.suggest.php / php



  <?php
  
  function getSuggested(query)
  {
    suggestions = array();
    query = explode(" ", query);
    linkID = db_connect();
    foreach(query AS word)
    {
      word = mysql_real_escape_string(word, linkID);
      query = "SELECT * FROM 06_google_suggest WHERE `word` = 'word'";
      suggest  = getAssoc(query, 2);
      if (count(suggest) > 0)
      {
        foreach (suggest as suggestion)
        {
          suggestions[] = suggestion;
          echo "Added a suggestion";
        }   
      }
    }
    return suggestions;
  }
  
  ?>


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.