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

  • SEARCH
  • Home
  • 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 8757539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:19:32+00:00 2026-06-13T14:19:32+00:00

I am fetching data in array and its get data when I use print_r

  • 0

I am fetching data in array and its get data when I use print_r function but when I display the array its said undefined data field.
any way to display result array();? I don’t want to use a foreach loop.

The code is:

$menu2=$this->load->common_model->getRecord('*','inner_menu','menu_page',2);
if ( $menu2->num_rows() > 0) { 
  $page1    =   $menu2->result_array();
  print_r($page1);
  <?=$page1['url']?>// here it said undeifned variable url
                    // url is in my db tabel inner_menu
}
  • 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-13T14:19:34+00:00Added an answer on June 13, 2026 at 2:19 pm

    Your syntax is really off, or you’re using CodeIgniter in a really strange or unacceptable way.

    First, you should be loading your models like this:

    $this->load->model('common_model');
    $this->common_model->getRecord();
    

    Your getRecord() method should be one that throws result_array() to the controller and not the controller calling upon it.

    Second, in order to get a better understanding, we would need to see some sample code of getRecord() for us to help you.

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

Sidebar

Related Questions

I can't get nl2br function to work after fetching data from my database: $result
Now a lot of scripts to facebook-style fetching data from url, but all of
I have a simple function that shows loading spinner while fetching data (usually takes
I have the following PHP object but I'm struggling to get the array item
I have problems fetching the database records, what is the best way to get
I am having one array where i am fetching data from database for some
Here's my problem. Given that I am saving data in an array: fetch.on('message', function(msg)
I'm fetching some objects out of a data store but the results aren't what
I'm fetching data from all 3 tables at once to avoid network latency. Fetching
I am fetching data from some tables & storing it in a variable like

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.