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
    Regular Coder
    Join Date
    Sep 2007
    Posts
    137
    Thanks
    1
    Thanked 0 Times in 0 Posts

    using anchor tag in php

    i need to insert a hyperlink to an sql query. there is a field in the table called url which consists of the url of a page, i would like this information to be displayed as a hyperlink so that i can click on the link.

    following is the code =

    $sql = " SELECT Count(*) .....";
    $rs_newEnquiries = mysql_query($sql, $connEnquiry);

    $echoStr = "<table width='80%' cellpadding=1 cellspacing=1 border=0><tr bgcolor='#cccccc;'><th bgcolor='#cccccc' width=10>Count</th><th bgcolor='#cccccc' width=400>Url</th></table>";
    while ($row_rs_newEnquiries = mysql_fetch_assoc($rs_newEnquiries))
    {
    $echoStr .= " <tr bgcolor='#ebebeb' class='default'> <td> ".$row_rs_newEnquiries['url']."</td>
    }

    please advice how i can convert this information that is being displayed into a hyperlink.

    thanks.

  • #2
    Senior Coder
    Join Date
    Mar 2003
    Location
    Atlanta
    Posts
    1,037
    Thanks
    14
    Thanked 30 Times in 28 Posts
    PHP Code:
    $echoStr .= " <tr bgcolor='#ebebeb' class='default'> <td> <a href='".$row_rs_newEnquiries['url']."'>".$row_rs_newEnquiries['url']."</a></td>\n"
    Most of my questions/posts are fairly straightforward and simple. I post long verbose messages in an attempt to be thorough.


  •  

    Posting Permissions

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