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 8074703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:44:31+00:00 2026-06-05T14:44:31+00:00

I have the following model that print_r shows Array ( [id] => 1 [cms_name]

  • 0

I have the following model that print_r shows Array ( [id] => 1 [cms_name] => Content Mangement System ) Currently in my controller I have $data['contentMangement'] = $this->model->function but I am unsure how to bring my above array into this.

function systemOptions($options)
    {   
        $this->db->select($options);

        $query = $this->db->get('options');

        if($query->num_rows() > 0)
        {
            $row = $query->row_array();

            $row['cms_name'];
        }
                print_r($row);

        return $query->result_array();
    }
  • 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-05T14:44:32+00:00Added an answer on June 5, 2026 at 2:44 pm

    If you want all of your options you can do this:

    function systemOptions($options)
    {   
        $this->db->select($options);
    
        return $this->db->get('options')->result_array();// will return empty array if there are no results
    
    }
    

    Or if you just want the first row (which is what it looks like from your question) you can do this:

    function systemOptions($options)
    {   
        $this->db->select($options);
    
        $result = $this->db->get('options')->result_array();
    
        if(!empty($result))
        {
          return $result[0];
        }else{
          return null; //or false or array(), or whatever you want
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following data model: I am writing a WCF service that needs
I have a User model that has the following default_scope: default_scope where(account_id: Account.current_account.id) If
I have a model class that uses a custom validator as shown in following
Say I have a model called User that has the following parameters: favorite_color, favorite_animal,
Currently, I have a controller action that outputs a PDF (as a Response.OutputStream.Write() )
I have a modal dialog that is created with the following: procedure TFormCompose.createParams(var Params:
Let's say that I have 4 models which are related in the following ways:
I have the following Model pattern: public abstract class PARENTCLASS {...} public class CHILD_A_CLASS
I have the following model structure: class Container(models.Model): pass class Generic(models.Model): name = models.CharacterField(unique=True)
I have the following model and instance: class Bashable(models.Model): name = models.CharField(max_length=100) >>> foo

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.