Hi everyone,
I am making a multiple keyword search engine that will search 3 different tables. it works ok, except that when i enter two keywords, it displays duplicate results.
if a person enters several keywords into the keyword text box, i explode the string into an array. then using the for loop, i loop through each keyword and within the for loop, i have an sql query statement that checks whether each word exists in any of the 3 tables.
sometimes, 2 or 3 keywords will appear in the same table within the same fields. this causes the duplicate results to display because the loop checks each keyword then prints out the result for each keyword, even if each keyword appears in the same field in the table.
i tried using array_unique function but it didn't seem to work. i might not have been using it properly as i am fairly new to php.
does anybody know how to eliminate the duplicate results from the multiple keyword search engine?
any help is greatly appreciated!! thanks
karren
I am making a multiple keyword search engine that will search 3 different tables. it works ok, except that when i enter two keywords, it displays duplicate results.
if a person enters several keywords into the keyword text box, i explode the string into an array. then using the for loop, i loop through each keyword and within the for loop, i have an sql query statement that checks whether each word exists in any of the 3 tables.
sometimes, 2 or 3 keywords will appear in the same table within the same fields. this causes the duplicate results to display because the loop checks each keyword then prints out the result for each keyword, even if each keyword appears in the same field in the table.
i tried using array_unique function but it didn't seem to work. i might not have been using it properly as i am fairly new to php.
does anybody know how to eliminate the duplicate results from the multiple keyword search engine?
any help is greatly appreciated!! thanks
karren