Hey guys
Just a quick question:
How to embed hyperlink into a database cell?
Basically I echo out a table on the user interface of my site
and there's an URL in one of the cells
I want the user to access it by clicking on it, without copying and pasting the URL into the URL bar of the browser
I tried updating the cell in phpmyadmin using <a href = http://www.example.com>http://www.example.com</a> but didn't work out, the resulting cell only had the text format
Any help would be appreciated
Thanks.
Hyperlink?
Moderator: General Moderators
Re: Hyperlink?
First, do yourself a favor and learn the way databases work. There is no such thing as a "cell" in a database. That's more than just terminology, it is fundamental to thinking about databases instead of spreadsheets, which do have cells.
Second, your problem has nothing at all to do with the database. When you use the data from the database to build your HTML, that's where you create a hyperlink, because the "anchor" syntax (<a href=...) is part of HTML, not part of the data.
So you should have PHP code which does something like this:
Second, your problem has nothing at all to do with the database. When you use the data from the database to build your HTML, that's where you create a hyperlink, because the "anchor" syntax (<a href=...) is part of HTML, not part of the data.
So you should have PHP code which does something like this:
Code: Select all
echo "<td><a href='" . $row['link'] . "'>" . $row['link'] . "</a></td>";