Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

embed hyperlinks into echo statements

Status
Not open for further replies.

DjKrispy

Technical User
Jul 16, 2005
1
AU
I have a field in my MySQL database named "HYPER_LNK" which contains hyperlinks to pages containing info about the people in my database. How can I use echo in a php page to not only list the people, but also make a link out of that list, if there is an entry in the "HYPER_LNK" field? Since quotes separate HTML from the php, it's kind of a puzzler.
 
hi,
just use
$link = mysql_result($result,$row,"HYPER_LINK");
if(!empty($link))
echo &quot;<a href=\&quot;$link\&quot;>text here</a>&quot;;

hope that will help u
cheers
spookie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top