Fahad Bhatti Fahad Bhatti - 1 month ago 12
MySQL Question

search partial string with white spaces in mysql

My table structure is like this

products_options_id | products_options_values_name |
544127 | Silver 925 Chains as per Gram |


this is my table structure but for search dynamically I have only "Silver 925 Chains" for search in this colomn But I got empty result set.

SELECT * FROM `products_options_values`
WHERE `products_options_values_name` LIKE '%Silver 925 Chains%'


Is there any other way to search partial string

Answer

check this, hope it will help you

SELECT * FROM `products_options_values`
WHERE MATCH(products_options_values_name)  AGAINST ('Silver 925 Chains' IN BOOLEAN MODE)