#1
  1. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    20
    Rep Power
    0
    Sorry if this is obvious but I have tried a number of permutations.

    I want to call $website and print it as a link.

    print $row["website"];

    Thanks in advance
  2. #2
  3. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Location
    Brussels, Belgium
    Posts
    14,643
    Rep Power
    4492
    what is in the column website??

    if it's just www.yourdomain.com, then use

    SELECT CONCAT('<a href="http://',website,'">',website,'</a>') AS link FROM your_table;

    Then you'd use

    print $row[link]

    Or, you could just do it with the pring statement:

    print "<a href="" . $row[website] . "">" . $row[website] . "</a>";

    ---JH

    ------------------
    *************************************************************
    * The manual can probably answer 90% of your questions...
    *
    * PHP Manual. www.php.net/manual
    * MySQL Manual: www.mysql.com/documentation/mysql/bychapter
    *************************************************************
  4. #3
  5. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    20
    Rep Power
    0
    Thanks for that, I am working on the first one, but the second one works fine.
    I found a similar post in the archives after I had posted, and got it working.
    My mistake was entering the data into $website as www.domain.com as opposed to http://www.domain.com - without the http bit it will always look for a local address.

    Hmmm maybe I should rtfm but due to the excellent tutorials here I was up and running and a bit snow blind!

    PHP/MYSQL rules!

    Thank You...........
  6. #4
  7. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Location
    Brussels, Belgium
    Posts
    14,643
    Rep Power
    4492
    They both do the same thing. In one, MySQL puts everything together, in the other PHP does it..

    so whatever works...works...

    ---JH

Similar Threads

  1. permissions after uploading
    By Paul Niessen in forum Perl Programming
    Replies: 3
    Last Post: February 15th, 2004, 05:51 PM
  2. Help with HTML Parsing
    By musashiBRS in forum Python Programming
    Replies: 6
    Last Post: February 13th, 2004, 02:32 AM
  3. Writing to two *.csv files
    By CAR in forum Perl Programming
    Replies: 4
    Last Post: February 7th, 2004, 04:39 PM
  4. need help with testing non-alphanumeric input
    By pinkipodmini in forum PHP Development
    Replies: 1
    Last Post: January 23rd, 2004, 01:48 PM
  5. howto get NICK_NAME and print results?
    By marnixvandalen in forum Perl Programming
    Replies: 0
    Last Post: January 5th, 2004, 01:35 AM

IMN logo majestic logo threadwatch logo seochat tools logo