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] Link to comment https://forums.phpfreaks.com/topic/30190-query-help/ 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. Link to comment https://forums.phpfreaks.com/topic/30190-query-help/#findComment-138830 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? Link to comment https://forums.phpfreaks.com/topic/30190-query-help/#findComment-138844 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? Link to comment https://forums.phpfreaks.com/topic/30190-query-help/#findComment-139337 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. Link to comment https://forums.phpfreaks.com/topic/30190-query-help/#findComment-142090 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.