i have written a method and model for keyword search. But unfortunately I am getting the output which are matched with my keyword and also which does not have any match with the keyword I typed.
Here is My Code:
controller.php :
function suggestions()
{
$this->load->model('Booksmodel');
$term = $this->input->post('term',TRUE);
$rows = $this->Booksmodel->GetAutocomplete(array('keyword' => $term));
$json_array = array();
foreach ($rows as $row)
array_push($json_array, $row->book_title);
array_push($json_array, $row->auth_firstname);
array_push($json_array, $row->isbn);
echo json_encode($json_array);
}
Please help me.