...

View Full Version : Displaying a field as a hyperlink from another field?



theon
11-01-2009, 07:42 AM
I have this table.
http://img510.imageshack.us/img510/1538/74049939.jpg


I have the following code:


echo "<td>$row[nation]</td>";
echo "<td>$row[area]</td>";
echo "<td>$row[capital]</td>";
echo "<td>$row[population]</td>";
echo "<td>$row[gdp]</td>";

I need the table to display the 'nation' field, but as a hyperlink taken from another field called 'url'. But I don't understand what code to use. I'm confused. Thanks.

attasz
11-01-2009, 12:18 PM
Try this:
$url="#";
echo "<a href='$url'>".$row['nation']."</a>";



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum