Re: Sessions and Pagination Problem
- From: mpar612 <mpar612@xxxxxxxxx>
- Date: Fri, 16 May 2008 05:24:20 -0700 (PDT)
First, thanks for the response! I don't get an error with the query.
I have multiple if statements that append "AND"'s to the SQL statement
based on the values contained in the $_SESSION variables. When the
page loads for the first time the SQL statement is right and the first
page is correct. If I click on one of the page numbers or the next
and prev buttons, the $_SESSION variables become populated with data
that is returned from the initial SQL query and all of the if
statements append all of the "AND"'s.
Here is a link to the example, please note that it is a WIP. Go to
http://www.visiongrouprealtyllc.com/index1.php and type "Detroit" in
the "City" field and click "Begin Search" (it might take a minute or
two to return the results). The first page you are taken to is
correct. If you click on page numbers and the prev or next links, the
SQL statement changes. I have the SQL statement printing on the page
so you can see how it is changing.
I know I have an error in my code and I am having difficulty finding
it on my own.
Thanks!
On May 16, 8:06 am, Rik Wasmus <luiheidsgoe...@xxxxxxxxxxx> wrote:
mpar612 wrote:
Hi everyone,
All of my php code is posted below. I apologize for the length. I am
new to using sessions and relatively new to getting pagination to
work.
When the page first loads, it works fine. However, when you click on a
Page # or the Next or Prev buttons, I get the message saying "Nothing
to Display!" which is in my code. There are over 7000 results in the
query and this first page only display 20, so I know there are plenty
of results.
Also, I tried printing the queries on the page and it is populating
the SQL query with results that were not originally in the
$_SESSION[''] variables. The query somehow changes when the user
clicks on the Page #, Next or Prev buttons.
I am sure that I am making some small error, but I am not picking up
on it. Does anyone have any thoughts that could send me in the right
direction? Please let me know if there is any additional info needed.
I don't really feel like checking ALL the code right now, does it tell
you what went wrong with the query it you:
$result = mysql_query($query) or die("Error: " .
mysql_error());
if(mysql_num_rows($result) == 0){
echo("Nothing to Display!");
echo "Query was $query;";
}
--
Rik Wasmus
[SPAM]
Now looking for some smaller projects to work on to fund a bigger one
with delayed pay. If interested, mail rik at rwasmus.nl
[/SPAM]
.
- Follow-Ups:
- Re: Sessions and Pagination Problem
- From: Rik Wasmus
- Re: Sessions and Pagination Problem
- From: Captain Paralytic
- Re: Sessions and Pagination Problem
- References:
- Re: Sessions and Pagination Problem
- From: Rik Wasmus
- Re: Sessions and Pagination Problem
- Prev by Date: Re: Help writing SQL statement in PHP script
- Next by Date: Re: Sessions and Pagination Problem
- Previous by thread: Re: Sessions and Pagination Problem
- Next by thread: Re: Sessions and Pagination Problem
- Index(es):
Loading