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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:39:41+00:00 2026-06-14T23:39:41+00:00

My controller is in this question: how to add pagination to this But now,

  • 0

My controller is in this question:
how to add pagination to this

But now, i’m getting undefined variable in my view,
View has an input

<input name='query'/>

which i receive it in controller as,

$query = $this->input->get('query'); 

Now, i am trying to pass the same query string back into my view
inside the link of pagination.

<a href="<php echo base_url(); ?>main/search/query=<?php echo $query; ?>&off=<?php echo $off=5;">1</a>

$off works but not $query. But i’m NOT saving the $query to the database.
so, i cant use $data['query'] as well. totally confused.

  • 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-14T23:39:42+00:00Added an answer on June 14, 2026 at 11:39 pm

    $off is not throwing an error because you are assigning the integer 5 to it.

    You need to pass data to the view from inside the controller by sticking it in an array like

     $data['query']= $query;
     $this->load->view('myview', $data);
    

    Then $query is available to the view. Not sure why you say you can’t do this

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

Sidebar

Related Questions

This question has some code to add to the controller closure, which is fine,
Newbee question here - I have this method in the view controller m: -(void)
I know this question has already been asked, but it seems that autoloading process
This question has been asked before, but none that I have reviewed give a
This is sample of function in the Staff controller for this question function newStaff()
Sorry, not clear how to ask this question. Here's my scenario: Controller HostSite hostSite=new
With this controller method: - [AcceptVerbs(HttpVerbs.Post)] public ViewResult Contact(Contact contactMessage) { return View(); }
All my controller has this code on the top of class. public class TestController
I have question model which has many options. In my question controller new action
I know this question is very similar to this one, but I feel its

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.