title: Hide a field if it is empty in MySQL / PHP
body: <p>I have a field called <code>urlOne</code> in my database. I would like it to only echo html if it has a URL as a value. Here is my code:</p>
  
  <pre><code>$id = $_REQUEST['id'];
  $query = "SELECT * FROM sites WHERE id = $id LIMIT 1";
  $result = mysql_query($query);
  $url = $row['urlOne'];
  while($row = mysql_fetch_assoc($result)){
      echo "&lt;section class='prop-desc'&gt;";
      echo $desc;
      echo "&lt;/section&gt;";
      $result = mysql_query("SELECT * FROM sites WHERE $id LIMIT 1");
      if(!empty($row['urlOne'])){
          echo "&lt;h4 class='cta'&gt;&lt;a href='$url'&gt;Launch Site&lt;/a&gt;&lt;/h4&gt;"
      }
  }
  </code></pre>