Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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'
share|improve this question
add comment

1 Answer

up vote 4 down vote accepted
SELECT Matrix.Name AS Name,
  CONCAT('https://',Matrix.DracIP) AS DracIP,
  Matrix.Asset
FROM Matrix
WHERE Matrix.Type = 'Physical-Lou1' 
share|improve this answer
1  
You're the best. Thanks! –  AaronJAnderson Nov 24 '11 at 3:17
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.