SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Hyperlink?

  1. #1
    SitePoint Enthusiast tommy168's Avatar
    Join Date
    Feb 2011
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Hyperlink?

    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.

  2. #2
    SitePoint Addict
    Join Date
    Dec 2005
    Posts
    336
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I'm lost but why not:
    PHP Code:
    $sql 'SELECT url FROM dbTable';
    foreach (
    $db->query($sql) as $row) {
        echo 
    '<a href="'$row['url'] .'">'$row['url'] .'</a>';

    Just store the url in the database instead of the HTML

  3. #3
    SitePoint Enthusiast tommy168's Avatar
    Join Date
    Feb 2011
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Got cha, thanks


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •