# Mutliple Autocomplete

**URL:** <https://www.phphelp.com/t/mutliple-autocomplete/25620>\
**Category:** Beginners - Learning PHP\
**Created:** [December 9, 2016, 7:07pm UTC](https://www.phphelp.com/t/mutliple-autocomplete/25620 "2016-12-09T19:07:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tqmd1](https://www.phphelp.com/letter_avatar_proxy/v4/letter/t/8c91f0/32.png) [@tqmd1](https://www.phphelp.com/u/tqmd1)\
**Post date:** [December 9, 2016, 7:07pm UTC](https://www.phphelp.com/t/mutliple-autocomplete/25620/1 "2016-12-09T19:07:51Z")

</div>

Sir I have these codes  
[php]

  

  

Code

  

Party

  

  

  
[/php]

and autocomplete.php has these codes

[php]\<?php  
include\_once(“includes/connectsql.php”);  
$searchTerm = $\_GET[‘term’];  
$query = “SELECT \* FROM master WHERE desc1 LIKE '”.$searchTerm."%’";  
$select = sqlsrv\_query($con,$query) or die (“Error”. sqlsrv\_errors($con)) ;  
while ($row=sqlsrv\_fetch\_array($select))  
{  
$data[] =$row[‘code’].’ - '. $row[‘desc1’];  
}  
//return json data  
echo json\_encode($data);  
?\>[/php]

The codes replies this data

![](http://i68.tinypic.com/wvy4co.png)

When I Enter the name of any CONTACT then his name + his code appear in same textbox  
But I want the code to appear in CODE text box,  
I want to get code and name in separate boxes.

In screenshot, I pressed ALI.

Please help
