I've a string in mysql that i want to randomise so that every time i run the query, i get different results.
The sample string
$str = '4_127','2_84','2_85';
So, i will pass it to the ORDER BY clause to randomise results.
SELECT `MY_SEARCH_PARAMS` FROM `mytable` WHERE `MY_WHERE_CONDTIONS` ORDER BY
FIELD( CONCAT( property_id,"_",catalog_id ), '4_127','2_84','2_85' ), `id` ASC;
I need a way so that the order of the string contents is changed everytime.
Thanks.
$str = '4_127','2_84','2_85';the actual string or you have tree strings which are4_127,2_84and2_85?concating...property_idcatalog_idas shown in the query. 4_127: 4 is property_id, 127 is catalog_id and so on...