Page 1 of 1

Help with search results on multiple pages

Posted: Mon Apr 10, 2006 3:36 pm
by mthierfelder
I am working on a search engine for a client, and for the most part it is working great. The part I need help or suggestions on is with the search results. Right now only the top 10 results are retreived, and displayed on one page. I would like it to retreive ALL results for a given search, display the first 10 on page 1, then subsequent results on pages 2, 3, etc.

Here is the query that is currently being called for the search results:

Code: Select all

$q1 = "select * from yellow_agents, yellow_priority, yellow_categories where yellow_agents.CategoryID = yellow_categories.CategoryID and yellow_agents.PriorityLevel = yellow_priority.PriorityLevel and yellow_agents.AccountStatus = 'active' order by visits desc limit 0,9 ";

$r1 = mysql_query($q1) or die(mysql_error());
$lrows = mysql_num_rows($r1);
"yellow" refers to this script's name because it is a yellow pages directory for businesses, there are different categories (electricians, contractors, etc.), and there are different priority levels (standard, gold, platinum, etc). Any help is appreciated, I don't know where to even start.

Oh, you can view the live script here: http://www.nwbuildnet.com/stores/builders/

Thanks in advance!
Mike

Posted: Mon Apr 10, 2006 4:24 pm
by Christopher
There is Pagination code in the Code Snippets section. I have some Pagination code with examples you can download here.

Posted: Mon Apr 10, 2006 5:08 pm
by mthierfelder
I'm pretty new at this, so I am not really sure where to even start...maybe over my head. Would you think this would be fairly complicated to figure out?

Mike

Posted: Mon Apr 10, 2006 6:28 pm
by Christopher
We won't know until you try out the code in the Code Snippets section or the download I provided a link to -- and tell us.