Ruslan Wahyudi Ruslan Wahyudi - 6 months ago 3x
HTML Question

How to take specific string in column mysql?

I have a table column that contain string like this :

<p><img alt="" src="" style="height: 267px; width: 500px;" /></p>

I want to take just string in src, i mean url link of image. how to do this??


You could use this :

SUBSTR(column, LOCATE(column, 'src="'), LOCATE(column, '"', LOCATE(column, 'src="'))

That would get the substring starting with src=" until the first " after that.