On Sat, 1 Sep 2001 14:01:57 +0200, BRACK ([EMAIL PROTECTED]) wrote:
>I have query -
>$res = mysql_query("SELECT
>skits.*,category.cat_id,category.cat_name FROM skits,category WHERE
>MATCH (title,descr,skits) AGAINST ('%$search_idea%') and skits.lang
>like 'English' and skits.category like category.cat_id  limit
>$limit,10 ");
>I expect to get results sorted by relevance and it actually does BUT
>inside of categories =( I mean it sorts result first by category and
>second by relevance. How do I make it to be sorted by only

try it like this:
$res = mysql_query("SELECT
skits.*,category.cat_id,category.cat_name,MATCH (title,descr,skits)
AGAINST ('%$search_idea%') as relevance FROM skits,category WHERE
skits.lang like 'English' and skits.category like category.cat_id
having relevance>0 order by relevance desc limit $limit,10 ");

PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to