How to display the contents of a return array from model to view in codeigniter?
Code: model
$arr_data[] =$query2;
return $arr_data[];
how to display the array contents in view page using codeigniter
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You get data from model, specify an array key element on controller, then while loading view you specify that array as second parameter. And in view, that key becomes your variable.
Sample model:
Sample Controller:
Sample view: