Filling array with jQuery and PHP
<p>I'm absolutely struggling with jquery. 
Essentially, I have a search bar, it queries my database, and dynamically fills the dropdown box with the relevant searches (Like any decent search bar.)</p>

<p>Anyway, I actually don't know how to allow a user to click on of the elements to add the data to an array.  Right now, it just </p>

<pre><code> echo '&lt;a href="index.php?action='.$result-&gt;game_id.'"&gt;';
</code></pre>

<p>And this works, but I want to be able to allow the user to select multiple things from the search bar.</p>

<p>If anyone could post some code, or point to a tutorial to help me figure this awful thing out.  </p>

<p>Thanks. </p>

<p>[EDIT]</p>

<p>I'm sorry, I don't think I was clear enough, and thanks for the info on the whole jquery autocomplete, but I already have that! </p>

<pre><code>if(isset($_POST['queryString'])) {
    $queryString = mysqli_real_escape_string($GLOBALS["___mysqli_ston"],$_POST['queryString']);

    // Is the string length greater than 0?
    if(strlen($queryString) &gt;0) {
        $query = mysqli_query($GLOBALS["___mysqli_ston"],"SELECT * FROM gamelist WHERE name LIKE '%" . $queryString . "%' LIMIT 8");

        if($query) {
            // While there are results loop through them - fetching an Object.

            while ($result = $query -&gt;fetch_object()) {
                echo '&lt;a href="index.php?action='.$result-&gt;game_id.'"&gt;';
                echo "&lt;img src = ".$result-&gt;image_thumb." height=46 width=46 /&gt;";

                $name = $result-&gt;name;
                echo '&lt;span class="searchheading"&gt;'.$name.'&lt;/span&gt;';

                 $description = $result-&gt;aliases;
                 if(strlen($description) &gt; 80) { 
                     $description = substr($description, 0, 80) . "...";
                 }                  
                 echo '&lt;span&gt;'.$description.'&lt;/span&gt;&lt;/a&gt;';
            }
            echo '&lt;span class="seperator"&gt;&lt;a href="http://www.marcofolio.net/sitemap.html" title="Sitemap"&gt;Nothing interesting here? Try the sitemap.&lt;/a&gt;&lt;/span&gt;&lt;br class="break" /&gt;';
        } else {
            echo 'ERROR: There was a problem with the query.';
        }
    } else {
        // Dont do anything.
    } // There is a queryString.
</code></pre>

<p>As you can see, when I get an input via _POST, the only way I can have a user interact with those results is to click the a href link.  I guess I'm only asking, what is some jQuery code that'll let me allow the user to click that, and store it back into the _POST[] array?  That way I can have them store multiple search items into the array so my PHP code can evaluate it.  </p>

<p>I hope that was more clear. </p>
