Getting ID from JQUERY Autocomplete
<p>I have an autocomplete from JQUERY and I want the ID of the product instead of the name of the product that I am choosing.   </p>

<p>This is the complete AUTOCOMPLETE:</p>

<pre><code>    &lt;?php

    // if the 'term' variable is not sent with the request, exit
    if ( !isset($_REQUEST['term']) )
    exit;

    // connect to the database server and select the appropriate database for use
    include 'conexion2.php';

    // query the database table for client codes that match 'term'
    $rs = mysql_query('SELECT id_cliente, nombrecliente FROM cliente where nombrecliente like "'. mysql_real_escape_string($_REQUEST['term']) .'%" order by nombrecliente asc', $conexio);

    // loop through each name returned and format the response for jQuery
$data = array();
    if ( $rs &amp;&amp; mysql_num_rows($rs) )
    {
    while( $row = mysql_fetch_array($rs, MYSQL_ASSOC) )
    {
        $data[] = array(
            'label' =&gt; $row['nombrecliente'],
            'value' =&gt; $row['nombrecliente'],
        );
    }
    }

    // jQuery wants JSON data
    echo json_encode($data);
    flush();
</code></pre>

<p>I dont know how to take out the ID when I choose a Client.  If I change 'value' => $row['id_cliente'], then I get the ID number in my autocomplete INPUT.... </p>
