tmaunga Posted December 13, 2007 Share Posted December 13, 2007 i have got url fields in my database eg www.sharp.com ,i wish to extract the field from the database and make it a hyperlink Link to comment https://forums.phpfreaks.com/topic/81463-making-a-url-in-a-database-a-hyperlink/ Share on other sites More sharing options...
Northern Flame Posted December 13, 2007 Share Posted December 13, 2007 you also need to store the text you want displayed in the link, then you simply just connect to your database and run this: <?php /* CONNECT TO DATABASE! */ $query = mysql_query("SELECT * FROM table"); while($row = mysql_fetch_array($query)){ echo '<a href="'.$row['url'].'">'.$row['text'].'</a><br>'."\n"; } ?> Link to comment https://forums.phpfreaks.com/topic/81463-making-a-url-in-a-database-a-hyperlink/#findComment-413584 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.