I am displaying a table from query results. One column (web) contains URLs which I am converting to links. The problem I am having is that it's also adding the links to empty fields. How can I this action from happening on empty rows?
$sql = "SELECT name,certificate,employer,city,state,web FROM table_1 ORDER by name";
$dbq = mysql_query($sql,$dbc);
echo "<TABLE>";
while ($row = mysql_fetch_array($dbq)) {
echo "<TR>";
echo "<TD>".$row['name']."</TD>";
echo "<TD>".$row['certificate']."</TD>";
echo "<TD>".$row['employer']."</TD>";
echo "<TD>".$row['city']."</TD>";
echo "<TD>".$row['state']."</TD>";
echo "<TD><a href='http://".$row['web']."' target='_blank'>web page</a></TD>"; //??Unless empty!
echo "</TR>";
}
echo "</TABLE>";