daniellynn2000 Posted August 3, 2008 Share Posted August 3, 2008 Is it at all possible to pull information from a mysql database so that when rendered in html it is rendered in a clickable html link? Link to comment https://forums.phpfreaks.com/topic/117914-html-links-from-mysql-database/ Share on other sites More sharing options...
trq Posted August 3, 2008 Share Posted August 3, 2008 Yes. Something like... <?php $sql = "SELECT link, address FROM links"; if ($result = mysql_query($sql)) { if (mysql_num_rows($result)) { while ($row = mysql_fetch_assoc($result)) { echo "<a href='{$row['address']}'>{$row['link']}</a><br />"; } } } ?> Link to comment https://forums.phpfreaks.com/topic/117914-html-links-from-mysql-database/#findComment-606525 Share on other sites More sharing options...
vicodin Posted August 3, 2008 Share Posted August 3, 2008 Or if your looking for something specific you can do something like this. mysql_select_db("Your DB") or die(mysql_error()); $query = "SELECT * FROM YourTable WHERE WhatEver ="TheThingYourLookingFor"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result); echo '<a href='.$row['Your Link'].' ">.'$row['HowYouWantToDescribeIt'].'</a>'; Link to comment https://forums.phpfreaks.com/topic/117914-html-links-from-mysql-database/#findComment-606527 Share on other sites More sharing options...
daniellynn2000 Posted August 3, 2008 Author Share Posted August 3, 2008 Thanks for the quick answers. I will be trying these tommorow. Thanks again. Link to comment https://forums.phpfreaks.com/topic/117914-html-links-from-mysql-database/#findComment-606537 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.