Linking with "echo"

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • dannysheps@hotmail.com
    Second Lieutenant

    • Feb 2008
    • 138

    Linking with "echo"

    Hello
    i wanted to know how can i create a link from query from my DB

    something like that ( that never works for me) :

    echo <a href="www.*****.com> $row['something']</a>

    im lost
  • Watdaflip
    Major General

    • Sep 2005
    • 2116

    #2
    Re: Linking with &quot;echo&quot;

    That will depend on your query and database structure, but it will be something like
    PHP Code:
    <?
    // assume database is connected

    $select = mysql_query("SELECT url_link, url_name FROM some_table");
    while($row = mysq_fetch_assoc($select))
    {
    echo '<a href="'.$row['url_link'].'">'.$row['url_name'].'</a><br />';
    }

    // close database connection
    ?>
    Hope that helps, post back if you need elaboration

    Register/Login Script
    Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

    Comment

    Working...
    X