Page 1 of 1

Please Help. Search results wont display next page.

Posted: Wed Dec 01, 2010 3:45 pm
by loztdogs
Hi I'm new to the site... and new to PHP, so excuse me if my verbiage isn't quite right. I've been struggling to find a solution to paging through my search results. MY code works for the first five entries that are found via the mysql query but when I click next five results, the code breaks down and sends me back to my index. I believe the problem is here in red:
// not last page so give NEXT link
$news=$s+$limit;

print "&nbsp;<a href=\"$PHP_SELF?s=$news&poster=$var\">Next 5 >></a>&nbsp&nbsp;";
}

$a = $s + ($limit) ;
if ($a > $numrows) { $a = $numrows ; }
$b = $s + 1 ;
echo "<br />";
echo "<br />";
echo "<p>Showing results $b to $a of $numrows</p>";
} If someone could help I would be so great full! Thanks in advance...

Re: Please Help. Search results wont display next page.

Posted: Wed Dec 01, 2010 4:18 pm
by curlybracket
Well... I think it will be difficult for anyone to help you.
First problem is that you should put place your PHP code between PHP tags - you can find button "PHP code" on the top of teaxtarea for editing the message. Second problem is that your code is chaotic and it's difficult to analyze it. You should break your problem into smaller chunks, otherwise you may never get any help.

Re: Please Help. Search results wont display next page.

Posted: Wed Dec 01, 2010 5:13 pm
by loztdogs
curlybracket wrote:Well... I think it will be difficult for anyone to help you.
First problem is that you should put place your PHP code between PHP tags - you can find button "PHP code" on the top of teaxtarea for editing the message. Second problem is that your code is chaotic and it's difficult to analyze it. You should break your problem into smaller chunks, otherwise you may never get any help.
Thanks for the advice. I cut down the code and inserted the "PHP code" function, although I don't see a difference...

Re: Please Help. Search results wont display next page.

Posted: Thu Dec 02, 2010 8:46 am
by loztdogs
Could someone please help?