With current MySql query is able to fetch src from the first img tag.
Query:
SELECT substr(substr(textfield , locate('src="', textfield ) + 5), 1,
locate('"', substr(textfield , locate('src="', textfield ) + 5)) - 1) as 'imgurl'
from pages where field1 ='data' and field2 = 'nothing';
Need to fetch all the src in all img tag in the cell of a row.
Example:
table column has id and text.
textfield has
some random content <img src='https://www.fakeurl.com/folder/image.jpeg'>
and also <img src="https://www.fakeurl.com/folder/image.jpg"> and also <img
src='/folder/image.jpeg'> and some additional content
Need to fetch all src from this textfield column using a query or a function or procedure in MySQL.
Result needed is:
https://www.fakeurl.com/folder/image.jpeg
https://www.fakeurl.com/folder/image.jpg
/folder/image.jpeg
What is needed to be modified to get result, or using some other query?