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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:00:51+00:00 2026-05-20T18:00:51+00:00

function index() { $info[‘title’] = ‘Browser Title’; $info[‘heading’] = ‘Blog Heading’; $info[‘query’] = $this->db->get(‘entries’);

  • 0
function index() {
    $info['title'] = 'Browser Title';
    $info['heading'] = 'Blog Heading';

    $info['query'] = $this->db->get('entries');
    $info['query'] = $this->db->order_by('id', 'asc');

    $this->load->view('blog_view', $info);
}

I’m creating a mini blog app from a tutorial and wanted to add in the option of displaying blog entries in order of ascending or descending by id. The code above gives me an error but I pasted it up here hoping someone would be able to show me the correct way to do it. I’ve consulted the CI user manual but couldn’t find any specific examples of what I”m looking for, which makes it somewhat confusing for a newbie like me.

  • 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-05-20T18:00:52+00:00Added an answer on May 20, 2026 at 6:00 pm

    It looks like the order is wrong, put the order-by first without the $info[‘query’]

    $info['title'] = 'Browser Title';
    $info['heading'] = 'Blog Heading';
    
    $this->db->order_by('id', 'asc');
    $info['query'] = $this->db->get('entries');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want to get the height property of a object: $('.selector img').each(function(index,e){ thisImage =
<?php class Email extends Controller { function Email() { parent::Controller(); $this->load->library('email'); } function index()
searchVersion: function (dataString) { var index = dataString.indexOf(this.versionSearchString); if (index == - 1) return;
Thanks in advance. Getting this warning when using below code: Warning: file_get_contents(test.php) [function.file-get-contents]: failed
Please consider this code snippet: var ul = $(.list_b).find(li).remove().end(); $.each(Sites, function (index, value) {
I want to be able to user query strings in this fashion. Domain.com/controller/function?param=5&otherparam=10 In
$(document).ready(function() { $('#somebutton').click(function() { $.get('List', function(responseJson) { $.each(responseJson, function(index, item) { var elem=$('<input type=checkbox
I have such code: function allValid() { $('input').each(function(index) { if(something) { return false; }
Why is the following code giving an exception? function SetText(index, text) { try {
The list.index(x) function returns the index in the list of the first item whose

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.