A HREF + DATABASE VALUES

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bconnor
Forum Newbie
Posts: 4
Joined: Tue Oct 31, 2006 12:07 am

A HREF + DATABASE VALUES

Post by bconnor »

I'm trying to echo a link, with one values from the database as the link itself, and the other the link name, how would i do that? Is it something like ...

echo "<a href=\"".mysql_result($result,0,"first");."\">mysql_result($result,0,"second");</a>";
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Have you tried it?
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: A HREF + DATABASE VALUES

Post by RobertGonzalez »

bconnor wrote:I'm trying to echo a link, with one values from the database as the link itself, and the other the link name, how would i do that? Is it something like ...

Code: Select all

echo "<a href="".mysql_result($result,0,"first");."">mysql_result($result,0,"second");</a>";
This is something that is covered in most tutorials. But before you rush out and grab a book or download a tutorial, why not try it? What is the worst that could happen if something went wonky?

PS Please, when posting code, even in small amounts, wrap that code in the appropriate bbCode tags. Thanks.
Post Reply