Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8104553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:52:59+00:00 2026-06-05T23:52:59+00:00

iam facing problem in passing array to view. this is my controller code.. function

  • 0

iam facing problem in passing array to view.
this is my controller code..

function mobile_view_post($a)
    {
        log_message('debug',__FILE__.', '.__LINE__.', '.__CLASS__.'/'.__METHOD__.'/'.__FUNCTION__.'');
        $this->load->model('Mmobiles');
        data['message']=$this->Mmobiles->mobile_view_post($a);
        $this->load->view('mobile_view_post',$data);
        log_message('debug',__FILE__.', '.__LINE__.', '.__CLASS__.'/'.__METHOD__.'/'.__FUNCTION__.'');

    }

model code return more than 5 rows..

function mobile_view_post($a)
    {
        log_message('debug',__FILE__.', '.__LINE__.', '.__CLASS__.'/'.__METHOD__.'/'.__FUNCTION__.'');
        //$output=false;
        $this->db->select('c1,c2,c3,c4');
        $this->db->from('ci_posts');
        $this->db->where('mobile_number',$a);
        $q=$this->db->get();
        $this->db->last_query();
        log_message('debug','******query '.$this->db->last_query().'  ********');
        if($q->num_rows()>=1)
        {

            return $q->row_array();
        }
        else
        {
            return 'No Reports';
        }



    } // end mobile_view_post

but this code is not working.below line giving me error in controller

 data['message']=$this->Mmobiles->mobile_view_post($a);

view code:

<?php
print_r($message);
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T23:53:01+00:00Added an answer on June 5, 2026 at 11:53 pm

    change

    data['message']=$this->Mmobiles->mobile_view_post($a);
    

    to

    $data['message']=$this->Mmobiles->mobile_view_post($a);
    

    And error messages are defined in index.php – make sure you are running in “development” environment to see the errors.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am using mvc 3 code first. facing problem while passing data form SecurityAttribute
Iam facing problem in understanding and converting a matlab code into opencv. I want
i am facing problem with the return type for this function and not really
Hope you all fine.I am facing some sort of problem while passing multiple parameters
I am facing this strange problem with strings. I assigned a string like this:
I am facing this problem of creating a font, other than the ones found
I am facing a problem with javascript in ie8. Iam hiding an element using
I am facing problem with hibernate annotations.For the code shown below I have a
I am facing problem in big decimal no. Following code snippet will explain my
I am facing a problem: I have two view controllers, viewController1 , and viewController2

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.