title: jquery autocomplete showing id and not label
body: <p>I'm using jquery's autocomplete function and it's working just fine except that when I select something from the drop down list, the input field get populated with the value and not the label.</p>
  
  <p>My code is as follows:</p>
  
  <pre><code> &lt;?php
     $query =     mysql_query("SELECT users.* FROM users JOIN peers ON peers.peer = users.user_id WHERE peers.user_id = '".$_SESSION['id']."'")or  die(mysql_error());
     $count   =   mysql_num_rows($query);
     $i   =   0;
  
     while($row = mysql_fetch_assoc($query))
     {
         $first[$i]   =   $row['first_name'];
         $last[$i]    =   $row['last_name'];
         $user_id[$i] = $row['user_id'];
  
         $i++;
     }
  
  $data = "";
  
  for($i=0;$i&lt;$count;$i++)
  {
      if($i != ($count-1))
      {
          $data .= '{ value: '.$user_id[$i].', label: "'.$first[$i].' '.$last[$i].'" }, ';
      } else
      {
          $data .= '{ value: '.$user_id[$i].', label: "'.$first[$i].' '.$last[$i].'" }';
      }
  }
  ?&gt;
  &lt;script type="text/javascript"&gt;
  $("#auto").autocomplete({ 
      source: data,
      select: function(event, ui)
      {
          var id = ui.item.value;
          var name = ui.item.label;
      }
    });
    &lt;/script&gt;
  
    &lt;input type="text" value="Enter a connection's name" id="auto" /&gt;
  </code></pre>