Using AutoSuggest in CodeIgniter

rjyanyan18's Avatar


14 Mar, 2013 03:04 AM

Hello Everyone! I need help in using the autosuggest plugin. I'm applying this plugin in CodeIgniter. I'm not sure where is the problem.
When I open the chrome dev tools console. I saw url/page?q=C (404 not found).
Please have a look at my code


$(function() { $('#attachment').autoSuggest("<?php echo base_url('documents/get_bar_codes.php'); ?>");



public function get_bar_codes()
{ $this->load->model('documents_model'); $data = $this->documents_model->get_reference_number(); echo json_encode($data);



public function get_reference_number()
{ $query = $this ->db ->select('reference_number') ->like('reference_number', mysql_real_escape_string($_GET["q"])) ->limit(10) ->get('documents'); $data = array(); foreach ($query->result() as $row)
{ $data[] = $row->reference_number; } return $data;

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Already uploaded files

  • Untitled.png 10.2 KB

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac