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.