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 9 of 9
  1. #1
    New Coder
    Join Date
    Jul 2006
    Posts
    63
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how do i insert a hyperlink in myql

    hi
    pls i want to know
    #1 how one can insert a hyperlink in a table

    #2be able to append it to a text area so it becomes automatically added to anything poated to the text area.
    thanx

  • #2
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,633
    Thanks
    4
    Thanked 148 Times in 139 Posts
    you would just add the link in mysql as plain text and you would format that with your php or coldfusion code when displaying it.

  • #3
    New Coder
    Join Date
    Jul 2006
    Posts
    63
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Uhuh, i see that now , it will surely work, can u pls give me an example in php of how to format it,
    thanx a mill

  • #4
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,633
    Thanks
    4
    Thanked 148 Times in 139 Posts
    do you know how to retrieve data from a table using PHP? IF so output something basic and I will show you how to add your links if you don't figure it out.

    if you don't know how to use php to retrieve data from the database and display it then visit php.net and search on mysql_fetch_array

  • #5
    New Coder
    Join Date
    Jul 2006
    Posts
    63
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hi
    i know how to display retrieved data from the database.
    am guessing when outputting it i will enclose it in anchor tags, is that it?

  • #6
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,633
    Thanks
    4
    Thanked 148 Times in 139 Posts
    yes that is all you would need to do. You may need to call it twice in your output code. once to tag it and once to display it.

    Code:
    <a href="yourdata">yourdata</a>

  • #7
    New Coder
    Join Date
    Jul 2006
    Posts
    63
    Thanks
    0
    Thanked 0 Times in 0 Posts
    cool, thanx man will try and let u knw how it goes.

  • #8
    New Coder
    Join Date
    Jul 2006
    Posts
    63
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hey
    thanks it worked here is how i did it
    PHP Code:
    while ( list($mod,$mname,$desc,$link) = mysql_fetch_array ($rs)){
                    
    $list .= "<tr>"
                    
                    
    $list .= "<td>"$mod."</td>"
                    
    $list .= "<td>"$mname."</td>";
                
    $list .="<td title=\"Click to view result\"><a href=\"$link\" target=\"_blank\">"$link."</a></td>"#retrieved data is converted to hyperlink 
    .

  • #9
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,633
    Thanks
    4
    Thanked 148 Times in 139 Posts
    Thanks for posting your solution, it will help someone who ends up in the thread because they have a similar problem.


  •  

    Posting Permissions

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