wuyuntao / jquery-autosuggest

A fork of AutoSuggest jQuery plugin writtern by Drew Wilson.
http://github.com/wuyuntao/jquery-autosuggest
118 stars 59 forks source link

using a URL to gather the Data Object is not working #39

Open naguibihab opened 9 years ago

naguibihab commented 9 years ago

I have tried using the library to preview emails when someone is filling in a form to send emails: $("#email").autoSuggest("http://www.ctarsplatform4.com/sherwood_DevTest/get_course_list.php?action=sendIRemail", {minChars: 2, matchCase: true, selectedItemProp: "email", searchObjProps: "email"});

However I called this link on its own (http://www.ctarsplatform4.com/sherwood_DevTest/get_course_list.php?action=sendIRemail) and I can see that it's returning some results.

And what I am calling is: elseif(isset($_GET['action']) && $_GET['action'] == 'sendIRemail') { $input = $_GET["q"]; $data = array(); // query your DataBase here looking for a match to $input $query = mysql_query("SELECT * FROM cms_external_email WHERE email LIKE '%$input%'"); while ($row = mysql_fetch_assoc($query)) { $json = array(); $json['email'] = $row['email']; $data[] = $json; } header("Content-type: application/json"); echo json_encode($data); }

But I am getting nothing back and the search is not working. Please help.

msherax commented 5 years ago

hi, did u fix this issue?

naguibihab commented 5 years ago

@msherax I can't remember to be honest, probably not if I didn't update the issue