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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:17:07+00:00 2026-05-27T20:17:07+00:00

I have a php page that pulls a few hundred characters (distributed amongst 8

  • 0

I have a php page that pulls a few hundred characters (distributed amongst 8 columns) of data from my database. It’s displayed on page one, but it needs to be available on page two as well. I am already submitting a form in order to make said page transitions.

What I’m wondering is if it is more efficient (or preferred for some other reason) to POST the data from the first page to the second, or if I should query the database for each page? There is another query for a different table on the first and second page as well, if that makes a difference.

Thank you very much!
Billy

  • 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-27T20:17:07+00:00Added an answer on May 27, 2026 at 8:17 pm

    If it is a truly small amount of data you have retrieved on your first page load, it may be more efficient to store it in $_SESSION rather than requerying it on subsequent pageloads. You should not post it to other pages through $_POST, however, as that would require sending all of the data down to the client browser and rendering it in HTML as some kind of form which would then get sent back up to the server in $_POST. $_SESSION is the better option.

    The purpose of $_POST is to supply user input from client to server, while the purpose of $_SESSION is to persist data between the client’s pageloads on the server side. That is exactly your situation.

    Always, the best way to know for sure is to profile your page loads with a tool like xdebug. Profile execution times when requerying and storing the data in $_SESSION to see which is more performant.

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

Sidebar

Related Questions

I have a php page that pulls data from a mysql database based on
I have a page (index.php) that pulls posts from mysql database. The posts are
So I have a PHP backend that pulls some data from SQL, let's just
I have a php page that displays rows from a mysql db as a
The Idea I have a main PHP page that loads content in DIV's from
I have a form text field that pulls a date from a database (in
I have a page that pulls up information based on an ID from the
I have just been implementing a google map, that pulls data from the yelp
I have currently created a facebook like page that pulls notifications from different tables,
I have a PHP page that returns a piece of HTML to set the

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.