Page 1 of 1

Sort output by relevance

Posted: Sun Mar 11, 2007 9:16 pm
by thiscatis
I'm working on a script that searches in one table for products.
A product has different attributes, so different colums in the table in the database.
I'm using the OR statement in SQL to compare post data with the product colums in the database.
Is there a way to sort the results by matching columns?
So that a product with more matching colums from the query ranks higher than another..
Hope you understand what I mean :D

Posted: Sun Mar 11, 2007 9:45 pm
by feyd
You can use the ORDER BY clause for this.