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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:07:37+00:00 2026-06-10T03:07:37+00:00

I have a PHP results page which starts off first-pass with ALL rows returned.

  • 0

I have a PHP results page which starts off “first-pass” with ALL rows returned. It’s a search listing of all pizza places in the county.

SELECT * from pizzeria;

Then the user can drill down into more detail… the page also has a CSS dropdown menu where the user can pick a specific neighborhood (which carries a URL):

href="samepage.php?neighborhood=HELLSKITCHEN"

which then changes the query after I pick up the $_GET[]

SELECT * from pizzaria WHERE nbh=(the $_GET[] variable sent in the URL);

but I’d like the page to call itself and I have header("Cache-Control:no-cache"); at the top.

I’m trying to create a first-pass or first visit flag variable with the isnull() function:

if (is_null($firstpass)) {
    $query = SELECT all the records from the pizzaria table
} else {
    $query = SELECT only the records WHERE I $_GET[] the value from the reloaded URL
}

It seems though that the $firstpass variable doesn’t stick on reloads. Should I SESSION that variable? (though still have the problem of constantly resetting it)

Or maybe implement some other approach?

I know I can redirect to a separate second page and javascript back to this page to avoid “headers already sent”, but I want to avoid the round-trip back to the client.

Is there a known best practice on reloads with new info? Kinda new to PHP here. thanks

  • 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-10T03:07:39+00:00Added an answer on June 10, 2026 at 3:07 am

    Maybe I didn’t understand well your problem but why wouldn’t you do :

    if (!isset($_GET['example'])) {
        $query = 'SELECT * FROM pizzerias';
    } else {
        $query = 'SELECT * FROM pizzerias WHERE pizzeria = \'.mysql_real_escape_string($_GET['example']).\' LIMIT 1';
    }
    

    at the first pass because, it seem that the $_GET variable is set only when the user choose a pizzeria?

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

Sidebar

Related Questions

I have this PHP code to highlight the Query on search results. if (isset($_REQUEST['k'])){
I have index.php page which makes a ajax call to thread.php by sending the
I have a PHP generated page containing the results of a submitted form, what
I have a PHP page on one server, which asks for some login details
I have this page which loads quotes. It has a search form wherein if
I have my php coded page on one server that returns a json result.
How do I show the results for $wordavg in php. I have done the
i have this code to get the search resutls from the api: querygoogle.php: <?php
What I am looking into is:- I do have a search page say index
I have a php script which constructs an array of objects based on HTML

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.