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

11-01-2009, 06:42 AM
I have this table.

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.

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

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum