Forum Moderators: open

Message Too Old, No Replies

Showing the proper search results

PHP/MySQL search results

         

ryan_b83

11:52 pm on Apr 12, 2007 (gmt 0)

10+ Year Member



Hello, I was just wondering if there was any way in general that was ideal for returning relevent searches from a database. Right now im just running this query and returning the results to php to display the products, but it seems that it dosn't really work very good all the time. Is there a better way between php and mysql to do this? It is only searching based on the title of the product. Maybe in the future if its not too difficult i'll try to search the description too.

select MATCH(`name`) AGAINST('".$searchVariable."') as relevence, pid, name, `desc`, price FROM product WHERE MATCH(`name`) AGAINST('".$searchVariable."')

Thanks!