Fahad Bhatti
Fahad Bhatti

Reputation: 35

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

Upvotes: 1

Views: 272

Answers (1)

AftabHafeez
AftabHafeez

Reputation: 173

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)

Upvotes: 1

Related Questions