Domanda

I can't figure out whether it is possible to copy links from 1 mysql field to another?

In the first field there is some text with a simple URL at the end: <a target="_blank" href="http://www.link.com/sdsdg">Anchor</a>

So how can I separate each link from other text and copy that link into another mysql field?

Thank you very much. : )

È stato utile?

Soluzione

Mysql has lots of string manipulation function See here

You can use these functions in a query for example: ( very simple example )

UPDATE table SET new_field = SUBSTRING(old_field, INSTR(old_field, '<a'), INSTR(old_field, '</a>') ) WHERE id = 10;

So with the use of SUBSTRING and INSTR and maybe a few others you can develop a query to do the job.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top