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

08-18-2006, 06:34 PM
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

08-18-2006, 08: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.

08-19-2006, 03: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

08-19-2006, 03: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

08-20-2006, 01:34 AM
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?

08-20-2006, 01: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>

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

08-22-2006, 04:44 PM
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


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