tags:

views:

23

answers:

4

i have words like 123.com , 234.org in database how to display them as links?

<?php
$con=mysql_connect("localhost","root","123");
mysql_select_db("www",$con);

$result=mysql_query("SELECT * FROM Tag");

for ($c=0; $c< mysql_num_rows($result); $c++)
{
$f=mysql_fetch_array($result);

###########echo $f['name']." ";
}
 mysql_close($con);
?>
+2  A: 

You need to output the HTML for a link. Something along the lines of:

print "<a href=\"" . $url . "\">" . $f['name'] . "</a>";

replacing url with the site URL you want the link to go to. It sounds like it might also be $f['name'].

ghills
A: 
echo '<a href="'.$f['name'].'">'.$f['name'].'</a>';
Brian Ray
A: 

links are html.

echo '<a href="'.$f['name']'.">Click me</a>';
Leon
A: 
Mike