Mysql – Add info to thesql view around an IP address – 10.10.1.100 to https://10.10.1.100

MySQLview

I have built a database in MySQL to replace the use of MANY excel spreadsheets that document our servers, network, IP addresses, etc.

In that database I have created a view called DRAC (dell remote access card) that pulls a server name, asset tag, and IP address.

SELECT Matrix.Name AS Name,
  Matrix.DracIP AS DracIP,
  Matrix.Asset
FROM Matrix
WHERE Matrix.Type = 'Physical-Lou1' 

I have been able to pull this information to a webpage (w/ DokuWiki+sqlcomp plugin) and it generates a nice table for me.

I was wondering if there was some kind of foo I could use to translate the ip address from this: "10.10.1.100" into this "https://10.10.1.100" within the view so it will display on the page as links that people can use instead of just a bare IP.

EDIT: I ended up w/ this code for those that are interested.

SELECT Matrix.Name AS Name,
  Concat('<a href="https://', Matrix.DracIP, '">', Matrix.DracIP,'</a>') AS DracIP,
  Matrix.Asset AS Asset                                                         
FROM Matrix
WHERE Matrix.Type = 'Physical-Lou1'

Best Answer

SELECT Matrix.Name AS Name,
  CONCAT('https://',Matrix.DracIP) AS DracIP,
  Matrix.Asset
FROM Matrix
WHERE Matrix.Type = 'Physical-Lou1'