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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:17:23+00:00 2026-06-06T08:17:23+00:00

Currently I am calling a title from the database using the below code it

  • 0

Currently I am calling a title from the database using the below code it works fine but I am wanting to implement a view all area (pulling other rows from the options table) in my admin area for the main options for my website.

What would be the best way to do this? Create another function for just the title? as I do not want to have a run a foreach loop just for the title.

function systemOptions()
{   

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

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

        $row['cms_name'];
    }

    return $row;
}
  • 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-06T08:17:24+00:00Added an answer on June 6, 2026 at 8:17 am

    I would do something like this;

    <?php 
    
    /*
    
    CREATE TABLE `options` (
      `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
      `name` varchar(64) DEFAULT NULL,
      `value` text,
      PRIMARY KEY (`id`),
      UNIQUE KEY `name` (`name`)
    );
    
    INSERT INTO `options` (`id`, `name`, `value`)
    VALUES
    (1, 'generic_keywords', 'This,is,my,generic.keywords'),
    (2, 'generic_description', 'This is a brief site summary'),
    (3, 'page_status_active', '1'),
    (4, 'page_status_draft', '2'),
    (5, 'page_status_invisible', '2'),
    (6, 'page_status_archived', '4'),
    (7, 'listing_length', '20'),
    (8, 'page_status_deleted', '9');
    
    */
    
    
    
    function systemOptions() { 
    
        $options = FALSE;
        $query = $this->db->get('options');
    
        if($query->num_rows() > 0) {
            foreach($query->result() as $row) {
                $data = new StdClass;
                $data->{$row->name} = $value;
                $options[] = $data;
            }
        }
    
        return $options;
    }
    
    function systemOption($name) {
    
        $query = $this->db->get_where('options', array('name' => $name), 1);
        return ($query->num_rows() == 1) ? $query->row() : FALSE;
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi All I am currently having an issue calling a WCF service from a
html img returned from ajax has class of 'tocrop'. Currently I Calling the function
I'm currently using this method in calling batch files in vb.net: Private Sub Button3_Click(ByVal
I am currently trying to access my database but receive the message Undefined variable:
I'm currently having trouble with calling a method using a select option data type.
So in this code all I am trying to do is create a view
We are currently calling web services on our application server through our web server
I am currently calling a ColdFusion web service in C#. The web service is
I'm working on an audio-intensive app for the iPhone. I'm currently calling a number
Currently I'm starting a new Activity and calling finish on a current one. Is

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.