title: Twitter bootstrap typeahead return multiple values and fillup the editbox
body: <p>I'm new in bootstrap and i need some help please, i want to create a typeahead drop-down that return 3 values from my mysql database when the user search for a contact name in <strong>"ContactName" TEXTBOX</strong> and fill up 3 edit box with the information of 
  -contact name
  -Telephone Number
  -email address
  thanks a lot on advance for all your effort</p>
  
  <p>this is the code that i try it to return one value i need to modified to return all those tree value
  Now when i try to search the contact name it will return with correctly with no question to ask but i don't know how to modify the code to bring 3 value like i mention above</p>
  
  <pre><code>enter code here
  
  **php page: Customer.php**
  -------------------------------------------
  &lt;?php
  $host = "localhost";
  $uname = "root";
  $pass = "";
  $database = "db34218";
  
  $connection=mysql_connect($host,$uname,$pass) or die("connection in not ready &lt;br&gt;");
  $result=mysql_select_db($database) or die("database cannot be selected &lt;br&gt;");
  
  if (isset($_REQUEST['query'])) {
  
  $query = $_REQUEST['query'];
  
  $sql = mysql_query ("SELECT ContactName, Telephone, Email FROM customer WHERE   ContactName LIKE '%{$query}%'");
  $array = array();
  
  while ($row = mysql_fetch_assoc($sql)) {
      $array[] = $row['ContactName'];
  }
  
  echo json_encode ($array); //Return the JSON Array
  }
  ?&gt;
  
  
  
  
  **html and java page and some php: Customersearch.php**
  ------------------------------------------------
  &lt;body&gt;
  .
  .
  .
          &lt;div class="row-fluid"&gt;
            &lt;div class="span4"&gt;
              &lt;label&gt;ContactName&amp;nbsp;&lt;/label&gt;
              &lt;input type="text" name="ContactName" value="&lt;?php echo     $row_Recordset_QuoteCustomer['ContactName']?&gt;" data-provide="typeahead" class="typeahead input-xlarge" autocomplete="off"&gt;
            &lt;/div&gt;
            &lt;div class="span2"&gt;
              &lt;label&gt;Telephone&amp;nbsp;&lt;/label&gt;
              &lt;input type="text" name="Telephone" value="&lt;?php echo     htmlentities($row_Recordset_QuoteCustomer['Telephone'], ENT_COMPAT, 'utf-8'); ?&gt;" class="span12"&gt;
            &lt;/div&gt;
            &lt;div class="span2"&gt;
              &lt;label&gt;Email &amp;nbsp;&lt;/label&gt;
              &lt;input type="text" name="Email " value="&lt;?php echo     htmlentities(row_Recordset_QuoteCustomer['Email '], ENT_COMPAT, 'utf-8'); ?&gt;" class="span12"&gt;
            &lt;/div&gt;
  .........
  .
  .
  .
  .
  .
  .
  
  &lt;script src="../js/jquery.js"&gt;&lt;/script&gt;
  &lt;script src="../js/bootstrap-transition.js"&gt;&lt;/script&gt;
  &lt;script src="../js/bootstrap-alert.js"&gt;&lt;/script&gt;
  &lt;script src="../js/bootstrap-modal.js"&gt;&lt;/script&gt;
  &lt;script src="../js/bootstrap-dropdown.js"&gt;&lt;/script&gt;
  &lt;script src="../js/bootstrap-scrollspy.js"&gt;&lt;/script&gt;
  &lt;script src="../js/bootstrap-tab.js"&gt;&lt;/script&gt;
  &lt;script src="../js/bootstrap-tooltip.js"&gt;&lt;/script&gt;
  &lt;script src="../js/bootstrap-popover.js"&gt;&lt;/script&gt;
  &lt;script src="../js/bootstrap-button.js"&gt;&lt;/script&gt;
  &lt;script src="../js/bootstrap-typeahead.js"&gt;&lt;/script&gt;
  &lt;script src="../js/SpecWorkPages/getItemsList.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  $(document).ready(function()
  {
  $('input.typeahead').typeahead({
      source: function (query, process)
      {
          $.ajax(
          {
              url: 'Customer.php',
              type: 'POST',
              dataType: 'JSON',
              data: 'query=' + query,
              success: function(data)
              {
                  console.log(data);
                  process(data);
              }
          });
      }
  });
  })
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  &lt;?php
  mysql_free_result($RecordsetQuote);
  mysql_free_result($Recordset_QuoteStatus);
  mysql_free_result($Recordset_QuoteCustomer);
  ?&gt;
  </code></pre>