3

I'm using this query to getresults from my database:

MATCH(`Text2`) AGAINST ('$s')

I want to get only results when there is a full match of the string, like when on google when you search between quotes "".

How can I do this with Match/MySQL?

EG: Query is "ab cd"

ID | Text
1    ab cd
2    aab cda
3    aab a cd

Row 1 and 2 should be returned

0

3 Answers 3

3

SELECT FROM your_table WHERE Text2 LIKE '%yourstring%';

Sign up to request clarification or add additional context in comments.

Comments

0

Try this:: If you need the wild search irrespective to the cases ::

SELECT FROM LOWER(mytable) WHERE LOWER(Text2) LIKE LOWER('%yourstring%');

Comments

0

You can use REGEXP for this purpose too.

SELECT *
FROM `tableName`
WHERE `columnName` REGEXP 'ab cd';

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.