Ruslan Wahyudi Ruslan Wahyudi - 1 year ago 56
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??

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download