'MySQL format text to hyperlink with same label
I have a table Products
ID | Productname | Product_url |
+----+-----------+--------------------------------------+
| 1 | ShirtXS | txthttps://www.product.com/shirt-xs |
| 2 | TrousersM | txthttps://www.trousers.org/tM-sizeM |
Product_url is VARCHAR(512)
How to write SQL query to format Product_url text to <a href="producttextvalue">Link</a> ?
Basically, all values from Product_url field should become links with same link labels.
https://www.product.com/shirt-xs to <a href="https://www.product.com/shirt-xs">Link</a>
https://www.trousers.org/tM-sizeM to <a href="https://www.trousers.org/tM-sizeM">Link</a>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
