Please Help. Search results wont display next page.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
loztdogs
Forum Newbie
Posts: 3
Joined: Wed Dec 01, 2010 3:43 pm

Please Help. Search results wont display next page.

Post 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...
Last edited by loztdogs on Wed Dec 01, 2010 5:11 pm, edited 1 time in total.
curlybracket
Forum Commoner
Posts: 59
Joined: Mon Nov 29, 2010 2:40 pm

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

Post 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.
loztdogs
Forum Newbie
Posts: 3
Joined: Wed Dec 01, 2010 3:43 pm

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

Post 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...
loztdogs
Forum Newbie
Posts: 3
Joined: Wed Dec 01, 2010 3:43 pm

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

Post by loztdogs »

Could someone please help?
Post Reply