Results 1 to 3 of 3

Thread: create link

  1. #1
    Join Date
    Jan 2007
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default create link

    Hi, I created database called "Homepage", and i created table called "homenews" inside of "homepage" database.
    I also created two column which is "News_Name" and "News_URL".

    I use dreamweaver and is works great when i retreive from databse, but i want to change to have link, let say first colmn for "news_name i put cnn, and second colmn for News_URL i put www.cnn.com, my question is that how i can write php code to create url link of "www.cnn.com" on the text called "cnn" when retreive from database!

    is this is correct code!

    <?php echo '<a href="'.$row_HomeNews[News_URL].'">'.$row_HomeNews[News_Name ].'</a>'; ?>

    if so when why I'm getting errors!

    AM

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Is $row_HomeNews defined as the mysql array? Post the full code and we can be of some more help.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. #3
    Join Date
    Jan 2007
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    when i used dreamweaver

    <body>
    <?php echo $row_HomeNews['News_Name']; ?>
    <?php echo $row_HomeNews['News_URL']; ?>
    </body>

    yes is $row...

    so how can i write tha code!

    AM

Bookmarks

Posting Permissions

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