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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:49:21+00:00 2026-05-24T19:49:21+00:00

Scenario No 1 On page1.php I use php with MySQL to get a product’s

  • 0

Scenario No 1

On page1.php I use php with MySQL to get a product’s data to the page. When a user wants to proceed to page, 2 he clicks on a button.

On page2.php there is also some info about the product, mainly for checkout purposes. For this data to be displayed I make use of the ID of the product so page2.php is actually page2.php?id=123. Therefore, using again PHP and MySQL I get the data I need.

Scenario No 2

On page1.php I use php with MySQL to get a product’s data to the page. The needed values for page2.php are stored in sessions. When a user wants to proceed to page 2, he clicks on a button.

On page2.php now, the information about the product is shown using sessions. This time page2.php is actually page2.php that it is shown on the address bar.

I prefer doing this with scenario 1. The user will be able to copy/paste or send through a button the page to a friend for direct access. I don’t think that one more hit to the db is a problem.

What is your opinion ?

  • 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-24T19:49:22+00:00Added an answer on May 24, 2026 at 7:49 pm

    I would agree that scenario 1 is better. You should use a session for its intended purpose, carrying state of a particular user, not misuse it as some form of caching mechanims in my opinion.

    That’s why you use the database in the first place – to have efficient access to your data. Why try to build a cache around the thing that should actually improve the efficiency if used?

    If access ever becomes a bottleneck and you really need to look into caching, then there are still better mechanisms than to use your session for this purpose.

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

Sidebar

Related Questions

Here's the scenario: I have a textbox and a button on a web page.
Here's my scenario: I have a page containing several links; each link is meant
The scenario is this. A web page contains: some DIVs whose visibility can be
Can a firefox XPCOM component read and write page content across multiple pages? Scenario:
Before reading, please note that I am very new to both PHP and MYSQL.
Ok, i have simple scenario: have two pages: login and welcome pages. im using
Here is the scenario: I have two asp pages. a.aspx is layout and b.aspx
Scenario: A stored procedure receives from code a DateTime with, let's say DateTime.Now value,
Scenario: You have an ASP.Net webpage that should display the next image in a
Scenario: Attempting to import many (>100), large(>1M recs) flat-files (csv). Problem: Many records are

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.