Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Displaying a field as a hyperlink from another field?

    I have this table.



    I have the following code:

    PHP Code:
    echo "<td>$row[nation]</td>";
                            echo 
    "<td>$row[area]</td>";
                            echo 
    "<td>$row[capital]</td>";
                            echo 
    "<td>$row[population]</td>";
                            echo 
    "<td>$row[gdp]</td>"
    I need the table to display the 'nation' field, but as a hyperlink taken from another field called 'url'. But I don't understand what code to use. I'm confused. Thanks.

  • #2
    New Coder
    Join Date
    Nov 2009
    Posts
    59
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Try this:
    PHP Code:
    $url="#";
    echo 
    "<a href='$url'>".$row['nation']."</a>"


  •  

    Posting Permissions

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