how to like something i retrieved via mysql

Discussion in 'MySQL' started by dawilster, Aug 23, 2008.

  1. #1
    i created a simple script what i want is when it retrieves the link i want it to hyperlink to that page so some how fit a href in there some how i cant seem to figure out how to do it thanks

    <?php
    // Connects to your Database
    mysql_connect("localhost", "godofwar_xtra", "pcraider") or die(mysql_error());
    mysql_select_db("godofwar_test") or die(mysql_error());
    $data = mysql_query("SELECT * FROM movies")
    or die(mysql_error());
    Print "<table border cellpadding=3>";
    while($info = mysql_fetch_array( $data ))
    {
    Print "<tr>";
    Print "<th>title:</th> <td>".$info['title'] . "</td> ";
    Print "<th>link:</th> <td>".$info['link'] . "</td> ";
    Print "<th>description:</th> <td>".$info['description'] . "</td></tr>";
    
    }
    Print "</table>";
    ?>
    
    Code (markup):

     
    dawilster, Aug 23, 2008 IP
  2. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #2
    Replace
    Print "<th>link:</th> <td>".$info['link'] . "</td> ";
    Code (markup):
    with
    Print "<th>link:</th> <td><a href='".$info['link'] . "'>".$info['link'] . "</a></td> ";
    Code (markup):
     
    mwasif, Aug 23, 2008 IP
  3. dawilster

    dawilster Active Member

    Messages:
    844
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    58
    #3
    thanks alot man
     
    dawilster, Aug 23, 2008 IP
  4. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #4
    Welcome!!!
     
    mwasif, Aug 24, 2008 IP
  5. CGSS-CyberGeek

    CGSS-CyberGeek Peon

    Messages:
    34
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hi,

    Please take into consideration the type of URI along with the validation of the URI. Validation as in:
    - Does it contain an extension?
    - Does it contain the protocol? (http | https)
    - Is the URI a full path to a filename? If so - check to make sure that the characters within the file name of the URI are replaced with the specific character combos. Example: www domain com/File Name.html should be www domain com/File%20Name.html

    Just a word of advice. :) Hope it helps.

    ** Note I have had to replace the . [dots] within the URI examples with a space due to permission reasons at the moment.
     
    CGSS-CyberGeek, Aug 24, 2008 IP