apedic
asked on
How to search a string in a mysql text field
Hello,
I need to search a string in a mysql text field that could contains newlines chars. Using the standard LIKE operator it does not work because the string searched is different from the text field as it contains newlines.
Here is an example:
select id from fb_posts where message like '%Fineco App. Tutti i servizi, in tutti i device. Da dove preferite collegarvi? https://welcome.fineco.it/bancaonline/extra/fineco-app%'
the string could not be found because the text field is:
So I think there should be e method to search removing newline chars.
thank you
I need to search a string in a mysql text field that could contains newlines chars. Using the standard LIKE operator it does not work because the string searched is different from the text field as it contains newlines.
Here is an example:
select id from fb_posts where message like '%Fineco App. Tutti i servizi, in tutti i device. Da dove preferite collegarvi? https://welcome.fineco.it/bancaonline/extra/fineco-app%'
the string could not be found because the text field is:
Fineco App. Tutti i servizi, in tutti i device.
Da dove preferite collegarvi?
https://welcome.fineco.it/bancaonline/extra/fineco-app
So I think there should be e method to search removing newline chars.
thank you
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thank you, works perfectly!
Glad I could help!
Open in new window
orOpen in new window
if the text is from Windows.HTH,
Dan