Jump to content

jmeulemans

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jmeulemans's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. 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>";
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.