+ Reply to Thread
Results 1 to 2 of 2

Thread: Linking with "echo"
      
   

  1. #1
    dannysheps@hotmail.com is offline Second Lieutenant
    Join Date
    Feb 2008
    Posts
    138

    Default 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

  2. #2
    Watdaflip's Avatar
    Watdaflip is offline Major General
    Join Date
    Sep 2005
    Location
    Cincinnati, Ohio
    Posts
    2,119

    Default Re: Linking with "echo"

    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49