The Little Guy Posted December 11, 2006 Share Posted December 11, 2006 I have this, and it gets 10 results (10 = $results_per_page)($s = current page number increment by 10 starting at 0)If I use just this, It will give me total results = 10, even when there are more than 10 results is there any way of doing this with out doing two queries?[code]$sql = "SELECT *, MATCH(urltitle,body,url) AGAINST ('%$var% IN BOOLEAN mode') AS score FROM web_search WHERE MATCH(urltitle,body,url) AGAINST ('%$var% IN BOOLEAN mode') LIMIT $s, $results_per_page";[/code] Quote Link to comment Share on other sites More sharing options...
btherl Posted December 11, 2006 Share Posted December 11, 2006 Just use two queries :) If the count is too slow, maybe you can fix it with an index on the expression you're matching on. Quote Link to comment Share on other sites More sharing options...
simcoweb Posted December 11, 2006 Share Posted December 11, 2006 Perhaps you're looking for a way to paginate your results? Meaning, it would display 10 results per page but place a Next 10 or page links to the other results? Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted December 11, 2006 Author Share Posted December 11, 2006 [quote author=simcoweb link=topic=118140.msg482499#msg482499 date=1165817588]Perhaps you're looking for a way to paginate your results? Meaning, it would display 10 results per page but place a Next 10 or page links to the other results?[/quote]That is what Im already doing.if I make it where I use 2 query, won't It slow it way down, since it has to do the search 2 times? Quote Link to comment Share on other sites More sharing options...
fenway Posted December 15, 2006 Share Posted December 15, 2006 Maybe I missed why it's not working... you have a limit and an offset. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.