anon Posted August 3, 2007 Share Posted August 3, 2007 Hello, I have created my database and I want it to have a row that, when retrieved, shows the result as an hyperlink. I am wondering if this is something that is done with PHP, but I would just like to know if there is a specific data set that displays as an hyperlink. Your help appreciated. ??? Quote Link to comment https://forums.phpfreaks.com/topic/63242-help-with-hyperlink-data-type/ Share on other sites More sharing options...
Barand Posted August 3, 2007 Share Posted August 3, 2007 MySQL has no hyperlink column type. Store URL in a varchar column. <?php $sql = "SELECT name, url FROM table"; $res = mysql_query($sql) or die (mysql_error()."<p>$sql</p>"); while (list($name, $url) = mysql_fetch_row($res)) { echo "<a href='$url'>$name </a> </br/>"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/63242-help-with-hyperlink-data-type/#findComment-315249 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.