View Full Version : jquery tokenizing autocomplete troubleshooting

12-01-2010, 04:12 PM
I'm playing with this tokenizing autocomplete script but am having a strange issue with it.

It all seems to work ok and it's pulling the values over from the php file that's doing the db query ok and if you put in a value that doesn't match it will tell you so, however if you do type in a value that matches it simply disappears.

This script is exactly like the demo script except for the paths to the js, css, and php files, and I did remove the 1st example but was having this issue before removing it. No changes made to the js file, php file is identical to the demo just with my own db info and table info put in, and no changes to the css file compared to the demo.

I've tried this both with jquery 1.3.0 and 1.4.2 and have the same issue with both.

Here is the link to my test page:
Here is my js file:
Here is my php code:

mysql_pconnect("localhost", "myuser", "mypass") or die("Could not connect");
mysql_select_db("mydb") or die("Could not select database");

$query = sprintf("SELECT cb_activities from jos_comprofiler WHERE cb_activities LIKE '%%%s%%' ORDER BY cb_activities DESC LIMIT 10", mysql_real_escape_string($_GET["q"]));
$arr = array();
$rs = mysql_query($query);

while($obj = mysql_fetch_object($rs))
$arr[] = $obj;

echo json_encode($arr);

A couple of values that are in my table are web development and kicking cats if you want to test it.

Here is the link to the demo:

It just doesn't make any sense to me why the demo works and mine doesn't when they are basically identical.

12-01-2010, 04:57 PM
Lol nm, forgot to change the table values in the js file.