Jump to content

Help with hyperlink data type!


anon

Recommended Posts

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. ???

Link to comment
https://forums.phpfreaks.com/topic/63242-help-with-hyperlink-data-type/
Share on other sites

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/>";
}

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.