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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:35:15+00:00 2026-06-12T09:35:15+00:00

So I have some data in MySQL being shown on my PHP page inside

  • 0

So I have some data in MySQL being shown on my PHP page inside a table. I’ve set it up so that each page only displays 3 results each (temporary until it goes live, then it will be more). Everything works fine and it displays those 3 results on each page just fine.

What I want to do is be able to change the amount of results on each page right from the main PHP page. I can change the amount shown on that one page, but as soon as I go to page 2, it resets to 3 results. How can I remember the number stored in the variable, and display it on every page? I tried using SESSIONS, but I couldn’t get it to work. I’m still a beginner btw.

$item = $_REQUEST['item'];
if(isset($_REQUEST['item'])){
    $limit=$item;
}
else{
    $limit=3;
}

//A few lines down -->    

<form action="<?php $_SERVER['REQUEST_URI']?>" method="post">
    Items: <input type="text" name="item">
    <input type="submit" name"go" value="Go">
</form>
  • 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-12T09:35:17+00:00Added an answer on June 12, 2026 at 9:35 am

    You could add SESSION use this way:

    $item = $_REQUEST['item'];
    if(isset($_REQUEST['item'])){
        $limit=$item;
        $_SESSION['item_limit'] = $limit;
    }
    else{
        // If we find a limit set in the session use that
        if (!empty($_SESSION['item_limit']) {
            $limit = $_SESSION['item_limit'];
        }
        else {
            $limit=3;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My scenario is that I have some payment transaction data in MySQL and some
For example I have a mysql query that gets some data. Then runs another
I have a MySQL/Rails app that needs search. Here's some info about the data:
I have some CSV data files that I want to import into mySQL. I
I have a list of data or quotes that are being displayed, I only
I have some data, yes, data. This data came from a MySQL query and
I have some data that is stored in a TIMESTAMP(6) WITH TIMEZONE column in
My table is being populated using ajax from a mysql database. I have a
Lets say I have a table with some data like the following: ID text
I have been trying to display a MySQL table for some time and I

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.