Autocomplete issues in 1.9.1

Autocomplete issues in 1.9.1

I used this code in jQuery UI 1.8.18 for autocomplete and it works fairly well.
  1. $(document).ready(function() {
  2. $("#cmntclientnameauto").autocomplete({
  3. minLength: 3,
  4. source: "ajax/clientlist.php", // Pull in names and addresses
  5. select: function( e, ui ){ // When we select one
  6. var keyvalue = ui.item.value;
  7. $.post("ajax/readclient.php",{id:keyvalue},
  8. function(data){
  9. // Pull in the data
  10. },"json"
  11. );
  12. }
  13. });
  14. });
This works great I get great looking menu style lists and it selects the info and sends it to readclient.php
Here is clientlist.php to give me the list to select from.
  1. $term = trim(strip_tags($_GET['term'])); // Need for the jQuery Autocomplete
  2. // Open the database
  3. $db = mysql_connect($hostname, $idname, $idpass);
  4. if (!$db) die(mysql_errno($db).": ".mysql_error($db)."\n");
  5. mysql_select_db($dbname);
  6. $sql = "SELECT DISTINCT Last_Name, First_Name, Address1, City, Prov_State, Postal, Client_ID, Phone FROM clients WHERE Last_Name LIKE '".$term."%' AND del_flag = 0 ORDER BY Last_Name";
  7. $q0 = mysql_query($sql);
  8. if (!$q0){error_log($sql,0);}
  9. else {
  10.     $json = '[';
  11.     $first = true;
  12.     while ($row = mysql_fetch_assoc($q0)) {
  13.         if (!$first) { $json .=  ','; }
  14. else { $first = false; }
  15. $json .= sprintf('{"value":"%s, %s, %s, %s, %s, %s, %d, %s"}',
  16. $row['Last_Name'], $row['First_Name'], $row['Address1'], $row['City'], $row['Prov_State'], $row['Postal'], $row['Client_ID'], $row['Phone']);
  17.     }
  18.     $json .= ']';
  19. }
  20. echo $json;

Like I said it works great to populate the selection menu.
Here is the readclient.php ajax script which reads the selection from above.
  1. $c = trim(strip_tags($_POST['id']));
  2. $client = explode(',',$c);
  3. $cid = $client[6];      // see the Client_ID field in clientlist.php
  4. // Open the database
  5. $db = mysql_connect($hostname, $idname, $idpass);
  6. if (!$db) die("Could NOT connect\n");
  7. mysql_select_db($dbname);
  8. $sql = sprintf("SELECT * FROM clients WHERE Client_ID = %d",$flds,$cid);
  9. $q0 = mysql_query($sql);
  10. if (!$q0){error_log($sql . ', ' . mysql_errno($db).": ".mysql_error($db),0);}
  11. else {$row = mysql_fetch_array($q0);}
  12. echo json_encode($row);

This code also works great. It returns the data record and I populate the form.
No rocket science here!! Almost textbook because I got the code from jQuery autocomplete examples.
Only problem now it doesn't work in 1.9.1. I currently am having extreme issues with 1.9.2 so I can't see if they fixed it.
HELP! I need my autocomplete. I have huge databases!