SELECT only the qualifying values from nominated columns with CodeIgniter's query builder to populate an autocomplete field with options
I am trying to write server-side scripting for an AJAX process which fetches the values from specific columns matching a search term. Unfortunately, my code returns all column values for each row which contains a match in any of the searched columns. This is problematic because I only want to collect the unique column values which are LIKE the search term. It will be unhelpful to use the non-matchong results in the autocomplete feature. How can I achieve what I need? My controller: function suggestions() { $this->load->model('Booksmodel'); $term = $this->input->post('term',TRUE); $rows = $this
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.