...

View Full Version : how do i insert a hyperlink in myql



husnamina
08-18-2006, 05:34 PM
hi
pls i want to know
#1 how one can insert a hyperlink in a table

#2be able to append it to a text area so it becomes automatically added to anything poated to the text area. :o
thanx

guelphdad
08-18-2006, 07:23 PM
you would just add the link in mysql as plain text and you would format that with your php or coldfusion code when displaying it.

husnamina
08-19-2006, 02:37 AM
Uhuh, i see that now ;) , it will surely work, can u pls give me an example in php of how to format it,
thanx a mill

guelphdad
08-19-2006, 02:41 AM
do you know how to retrieve data from a table using PHP? IF so output something basic and I will show you how to add your links if you don't figure it out.

if you don't know how to use php to retrieve data from the database and display it then visit php.net and search on mysql_fetch_array

husnamina
08-20-2006, 12:34 AM
hi
i know how to display retrieved data from the database.
am guessing when outputting it i will enclose it in anchor tags, is that it?

guelphdad
08-20-2006, 12:41 AM
yes that is all you would need to do. You may need to call it twice in your output code. once to tag it and once to display it.


<a href="yourdata">yourdata</a>

husnamina
08-20-2006, 12:49 AM
cool, thanx man will try and let u knw how it goes. ;)

husnamina
08-22-2006, 03:44 PM
hey
thanks it worked here is how i did it


while ( list($mod,$mname,$desc,$link) = mysql_fetch_array ($rs)){
$list .= "<tr>";

$list .= "<td>". $mod."</td>";
$list .= "<td>". $mname."</td>";
$list .="<td title=\"Click to view result\"><a href=\"$link\" target=\"_blank\">". $link."</a></td>"; #retrieved data is converted to hyperlink




.

guelphdad
08-22-2006, 05:01 PM
Thanks for posting your solution, it will help someone who ends up in the thread because they have a similar problem.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum