Re: Sessions and Pagination Problem



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]

.



Relevant Pages

  • Re: Error using " in .open with ADODB.Recordset
    ... recordset but I'm getting hung up on the SQL statement. ... query that has a string as a condition. ... Dim mrk As String ...
    (microsoft.public.data.ado)
  • Re: expiration
    ... First what type of field are you applying the criteria against? ... You can try the following in a query. ... If you are trying to get just records with the License has expired within ... it is the actual SQL statement that is executed. ...
    (microsoft.public.access.queries)
  • Re: Same date range in main and sub form
    ... You need to concatenate together the parts to make up the SQL string ... it will look like the SQL statement you original ... Allen Browne - Microsoft MVP. ... well as the name of the query on which the form is based. ...
    (microsoft.public.access.forms)
  • Re: Filter multiple results by user input
    ... and will append the selected information into a new table. ... Using the "backend" of this table I can filter the numbers ... one number and then the query will execute. ... Let's say the append query had the following SQL statement ...
    (comp.databases.ms-access)
  • Re: expiration
    ... If you are trying to get just records with the License has expired within ... In the Design view of the query ... This query is based off the existing employee database created by someone ... it is the actual SQL statement that is executed. ...
    (microsoft.public.access.queries)