Skip to content
Advertisement

calling controller function from view and retrieving rows from db using AJAX in codeigniter

I am trying to retrieve rows from database by making an AJAX call to the controller function. I have no error messages and the code is executing properly upto $(“#msgbox”).html(“Type the name of someone or something…”);

I think the controller is not called properly from the view. Below is my MVC code.

My view: welcome_message.php

JavaScript

My controller: Welcome.php

JavaScript

My model: Select.php

JavaScript

Advertisement

Answer

You can call your helper in your constructor

JavaScript

And your ajax url is

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement