Menu

Autocomplete with mysql database?

Help
Anonymous
2006-08-30
2013-04-10
  • Anonymous

    Anonymous - 2006-08-30

    I could not find any working examples of using the phpAjaxTags autocomplete with a mysql database (using legacy code).

    Please provide working examples of an autocomplete that works with a mysql database.

    I tried this, but it just doesn't work.

    [code]
        $glArray = array();

        $sql = 'SELECT * FROM companies WHERE company_name LIKE "' . $name . '"%"';
        $res = execute( $res );
        while ($row = mysql_fetch_object($res)) {
            array_push($gl_array, $row->address1);
        } // wend

      function cxmlByName($name){
        global $glArray;
          foreach($glArray as $k => $v){
              foreach($v as $k2 => $v2){
              //cho $k.'='.$v.' ';
              if (strpos('_'.$v2,$name)>0)
                  echo '<item><name>'.$v2.'</name><value>'.$k.'</value></item>';
              }
          }
    } // end function
    [/code]

     
    • Virtimus

      Virtimus - 2006-11-25

      Well - from what I see - You have just a typo :)
      $glArray = array();
      array_push($gl_array  ...

      Sorry for the late answer - unfortunatelly I'm a busy person :(

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.