title: If else PHP statement with variable inside href and li
body: <p><a href="https://i.stack.imgur.com/LE80c.png" rel="nofollow noreferrer">enter image description here</a>I have URLs in the database being called by either with $p_camping or $p_hiking</p>
  
  <p>if they're empty, they echo nothing, if the table contains a url for hiking/camping, it will echo a url in an li.</p>
  
  <p>It properly shows empty if the table cell is empty, but it will not echo the href in an li properly, it just spits out the full html link without an li or line break</p>
  
  <p>I've tried countless ways of writing the echos but nothing seems to work, below are two i've tried</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!-- HTML --&gt;
  
   &lt;ul&gt;
      &lt;? echo "$p_camping" ?&gt;
      &lt;? echo "$p_hiking" ?&gt;
   &lt;/ul&gt;
   
   
   &lt;!-- PHP INCLUDE with two variations i've tried out of many --&gt;
   
   $row = mysqli_fetch_array($result);
    $p_camping = $row['p_camping'];
    $p_hiking = $row['p_hiking'];
      
    
   else
  {
    echo "&lt;li&gt;&lt;a href='".$p_camping."'&gt;Camping Info&lt;/a&gt;&lt;/li&gt;";  
  }
  
  
  if(empty($row['$p_hiking']))
  {
      // it's empty!
      echo " ";
  }
  else
  {
    echo "&lt;li&gt;&lt;a href=\"$p_hiking\"&gt;Hiking Info&lt;/a&gt;&lt;/li&gt;";  
  }</code></pre>
  </div>
  </div>
  </p>