shalu Posted January 15, 2014 Share Posted January 15, 2014 I am using MYSQL ,MYISAM table type and php version 5.4.16 and am doing a fulltext search based on the (product_name) column and i want to randomize the result of rest of the columns but the problem is rand()not giving the random values. I tried something like this: SELECT `product_name`,`main_cat_id`,`sub_cat_id`,`prod_cat_id`,`prod_short_desc`,`com_id`,`product_id`,product_ratings, `min_order_quantity`, `fob`,`country_id`,`company_name`,`attributes`,`attr_values`,`verify`,`image`,product_additionals , MATCH (`product_name`)AGAINST ('"girls top"'IN BOOLEAN MODE) AS relevance, MATCH (`product_name`)AGAINST ('girl* +top*'IN BOOLEAN MODE) AS relevance1 FROM pep_browse_com_prods WHERE (MATCH (`product_name`) AGAINST ('"girls top"'IN BOOLEAN MODE) OR MATCH (`product_name`) AGAINST ('girl* +top*'IN BOOLEAN MODE)) AND STATUS = '0' AND display = '0' ORDER BY relevance DESC,relevance1 DESC,RAND() limit 20; I want to set the relevance first then i want the random values of rest columns. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.