I use jquery's autocomplete on my site. Right now the menu it produces has links that you can click.
However, when you click them they simply go into the text field. I would like to be able to click on the link (or press enter) and be taken to another page, specifically change the URL's get variable.
To make this a little more complicated, each item in the drop down is assigned an ID by my mysql database. The link that each item should go to is index.php?id=$id where $id is its ID from the database.
Since I have hundreds of items in the menu, how can I alter the current code to include links that redirect to index.php?id=$id getting $id from my database?
CODE: standard code from http://jqueryui.com/demos/autocomplete/
<script> $(function() { var availableTags = [ <?php include 'connect.php'; $result=mysql_query("SELECT * FROM searchengine"); while ($row=mysql_fetch_assoc($result)){ $title=$row['title']; $id=$row['id']; echo "\"$title\","; } ?> ]; $( "#tags" ).autocomplete({ source: availableTags }); }); </script> P.S. I use php inside the jquery to generate a list of variables.