Currently I am using plugin called jQuery TagHandler. How can I link with database to listout data. I have listed code samples below. Below code are not working. Please correct me.
js
$("#array_tag_handler").tagHandler({
getData: { id: '1', type: 'user' },
getURL: '/tag/interest',
updateData: { id: 'user234', type: 'user' },
updateURL: '/ajaxtest/update',
autocomplete: true,
autoUpdate: true
});
PHP
$select_pos = "SELECT title FROM homegrid";
$select_exec = mysql_query($select_pos);
$return_data = array();
while($dataFromDB = mysql_fetch_assoc($select_exec)) {
$return_data[]= array(
"title" => $dataFromDB['title'],
);
}
header('Content-Type: application/json');
echo json_encode($return_data);