Forum Moderators: coopster

Message Too Old, No Replies

Want to search the content within site

Want to search the content within site

         

shaid

10:02 am on Jan 11, 2008 (gmt 0)

10+ Year Member



Hello
I want to get search result from all the pages in a site. How can I do this?

For more clarify:

I have several table from which the contents are showing in the pages, like: forum, news section and others also...
They all are stored in different table.
Now I want to search for any anything within the side that is possible.
How can I accomplish that easily so that the pagination can be done easily too.

Now what I have done already:
I already got the search result in an array appending from all the quarries. But I am problem with pagination, because every time I click on next or previous page it is quarrying from the start up point though I am showing the result correctly. so my problem is on loading data because all time it is loaded fully and then showing the required part. This is happening because I have to search various result to get the data separately and then combine.

Is their any way to get rid off from this?

Thank you.

But I

Sonnenblume

3:27 pm on Jan 11, 2008 (gmt 0)

10+ Year Member



From what I can gather, you are correctly getting the script to calculate the number of pages you need to display your search results. But when you click on a page number (i.e. page 4), it is just returning the same set of data again.

You need to use the MySql (or whatever RDBMS your using) function limit. It will basically allow you to select data from within a specified range.

i.e. SELECT * FROM tablename WHERE condition LIMIT 0, 15

This query would returns rows 1 - 15.

i.e. SELECT * FROM tablename WHERE condition LIMIT 15, 15

this query would return rows 15 - 30

[edited by: Sonnenblume at 3:28 pm (utc) on Jan. 11, 2008]