Hyperlinks in SQL Table

  • tomrulez
  • Expert
  • Expert
  • User avatar
  • Posts: 571
  • Loc: England!!

Post 3+ Months Ago

Hi,
I'm storing some hyperlinks in an sql table and then using some php and an sql query to display them on screen however I can't figure out how to make the url's clickable. Below is my sql code.
Code: [ Select ]
$data = mysql_query("SELECT `progid` , `programme` , `level` , `link`
FROM `progs`
LIMIT 0 , 30")
or die(mysql_error());
Print "<table border cellpadding=3>";
while($info = mysql_fetch_array( $data ))
{
Print "<tr>";
Print "<th>ProgID:</th> <td nowrap='nowrap'>".$info['progid'] . "</td> ";
Print "<th>Programme:</th> <td nowrap='nowrap'>".$info['programme'] . "</td> ";
Print "<th>Level:</th> <td nowrap='nowrap'>".$info['level'] . "</td> ";
Print "<th nowrap='nowrap'>Documentation:</th> <td nowrap='nowrap'>".$info['link'] . " </td></tr>";
}
Print "</table>";

  1. $data = mysql_query("SELECT `progid` , `programme` , `level` , `link`
  2. FROM `progs`
  3. LIMIT 0 , 30")
  4. or die(mysql_error());
  5. Print "<table border cellpadding=3>";
  6. while($info = mysql_fetch_array( $data ))
  7. {
  8. Print "<tr>";
  9. Print "<th>ProgID:</th> <td nowrap='nowrap'>".$info['progid'] . "</td> ";
  10. Print "<th>Programme:</th> <td nowrap='nowrap'>".$info['programme'] . "</td> ";
  11. Print "<th>Level:</th> <td nowrap='nowrap'>".$info['level'] . "</td> ";
  12. Print "<th nowrap='nowrap'>Documentation:</th> <td nowrap='nowrap'>".$info['link'] . " </td></tr>";
  13. }
  14. Print "</table>";


Line 12 deals with printing the url's to the screen. Anyone got any clues?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9088
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

Wouldn't be too hard to do. You would just do something like this:

Code: [ Select ]
print "<th nowrap='nowrap'>Documentation:</th> <td nowrap='nowrap'><a href='". $info['link'] . "'>". $info['link'] . "</a></td></tr>";

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 96 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.