enter image description hereGood day! Paging all database engineers and masters may i have your attention for a while.
I am currently developing our Travel Recommender System and we're having a problem with ORDER BY LIKE SEPARATED COMMAS IN MYSQL.
I have two tables: -tb_users(this table has a field of "Traveler_Style" where it contains of registered style of what kind of traveler they are. the values of "Traveler_Style" is based on their preferences. Sample value of this is Backpacker, Nightlife)
-attractions(this table has a field of "traveler_style" consist of Backpacker, Nightlife, luxurytraveler )
In my search engine when the user enters an attraction in will ORDER BY LIKE based on the registered "Traveler_Style" on tb_users that will "LIKE" or Match to the record in the table attractions.
I tried to declare a variable to call the value of tb_user Traveler style which is $style_fetch and here's my idea to select the query
$query6 = "SELECT * FROM `attractions` WHERE CONCAT(`categories`, `tourist_spot`, `province`) LIKE '%".$valueToSearch."%' ORDER BY FIELD(traveler_style, '$style_fetch') DESC limit 8";
Expected output should be order by like based on the traveler style of a user