MySQL Forums
Forum List  »  Newbie

pagination of search results: here's some code that works
Posted by: Michele Elliott
Date: May 23, 2007 01:17AM

I wanted to pass this on to others so they don't have the same problem I've had with this subject.

I'd created a pagination code to break up the results of a database search. My results were never able to get past ten even when what I'd been testing had over ten results. Here's what I had to do to find out what was going on.

To see what a query is sending you need to print it out. Place print $yourquery; below the query code. Do this for all the queries in your code.

It was pointed out to me on another forum that my counting code had an empty string which showed up when I printed the code. The second piece of code was working properly (the string was full). The reason why turned out to be very simple.

I had to move the following piece of code
$searchwords = mysql_escape_string($_GET['words']);
from the middle of my page, just above a query which was working (because this line was above it) and place it at the start of my code above another query which was not working (because this line of code was NOT above it).

I'm not an expert but I assume this piece of code is what fills the query strings.

Options: ReplyQuote


Subject
Written By
Posted
pagination of search results: here's some code that works
May 23, 2007 01:17AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.