Re: Hyperlink display problem

From: Date: Sat, 20 Jul 2002 07:05:57 +0000
Subject: Re: Hyperlink display problem
Groups: php.general 
Request: Send a blank email to php-general+get-108640@lists.php.net to get a copy of this message
>I am a beginner at using PHP, and am developing a product "template" >utilizing a MySQL database. Basically, what I am attempted to do, in the >code below is: > >Code sample: >================================================ >printf(($result["REL_PLAN1"]), mysql_result($result,0,"REL_PLAN1")); >================================================ > >Questions: >1. In the first part, print out the value of the REL_PLAN1 database field >for display purposes. The value in this field will be in the format >http://www.yahoo.com. > >2. In the second part, make the value in the >mysql_result($result,0,"REL_PLAN1") field display on the page as a clickable >hyperlink. > >Basically, I want the value displayed in part 1 to change depending on what >value is actually in the REL_PLAN1 db field (in part 2). Hope this makes >sense. > >Any help would be greatly appreciated. Thanks. You've got to at least give us some clue what you expect to have in $result['REL_PLAN1'] and in the database, or some sample input/output of what you are trying to do... Are you allowing *ANY* valid input to printf() to be in the array? Also, there's simply *NO* *WAY* you can use $result as both an array ($result['REL_PLAN1] and a mysql resource (mysql_result($result, 0, 'REL_PLAN1')). They'll have to be different variables. Or maybe you just want this: function print_link($URL, $text){ echo "<A HREF='$URL'>$text</A>"; } I'm not getting the question, and I doubt anybody else is either... -- Like Music? http://l-i-e.com/artists.htm

« previous php.general (#108640) next »