title: HTML inside PHP not working
body: <p>I have been trying to put HTML inside PHP for a while, but I could never get it to work. Instead I have had to use this</p>
  
  <pre><code>&lt;?php //code in here 
  while($record = mysql_fetch_array($myData)){
  ?&gt;
  //HTML code
  &lt;?php
  }
  ?&gt;
  </code></pre>
  
  <p>and it has worked for a while, but now I'm implementing a search function to the page, and I need all HTML to be dynamically generated, or the page will be displayed twice. Therefore, i'm in need of some help. This is the old-new code I have at the moment.</p>
  
  <pre><code>&lt;?php 
  $sql = "SELECT * FROM `LISTINGS` ORDER BY YA DESC $limit";
  $myData = mysql_query($sql,$con);
  while($record = mysql_fetch_array($myData)){
  
  //this is what i have manage to get done    
  echo '&lt;div class="cards-row"&gt;';
      echo '&lt;div class="card-row"&gt;';
          echo '&lt;div class="card-row-inner"&gt;';
              echo '&lt;div class="card-row-image" data-background-image="http://domains/$record["IMAGENAME"].jpg"&gt;';
              echo '&lt;/div&gt;';
  
              echo '&lt;div class="card-row-body"&gt;';
                  echo '&lt;h2 class="card-row-title"&gt;';
                      echo '&lt;a href="http://domain/listing-detail.php?ID='; $record['ID']echo'"&gt;'
                      echo '&lt;/a&gt;';
                  echo '&lt;/h2&gt;';
              echo '&lt;/div&gt;';
  
          echo '&lt;/div&gt;';
      echo '&lt;/div&gt;';
  echo '&lt;/div&gt;';
  ?&gt;
  </code></pre>
  
  <p>Static/dynamic code</p>
  
  
  
  <p></p>
  
  <pre><code>    &lt;div class="card-row"&gt;
          &lt;div class="card-row-inner"&gt;
              &lt;div class="card-row-image" data-background-image="http://www.domain/&lt;?php echo $record['IMAGENAME'];?&gt;.jpg" width="150" height="180" "&gt; 
  
              &lt;/div&gt;&lt;!-- /.card-row-image --&gt; 
  
              &lt;div class="card-row-body"&gt;
                  &lt;h2 class="card-row-title"&gt;
                  &lt;a href="http://www.domain/listing-detail.php?ID=&lt;?php echo $record['ID'];?&gt;"&gt; &lt;?php custom_echo ($record['TITLE'], 80); ?&gt;&lt;?php if($record['STREET']===' '){ echo "Not provided" ;}?&gt;
                  &lt;/a&gt;
                  &lt;/h2&gt;
                  &lt;div class="card-row-content"&gt;&lt;?php custom_echo ($record['DESCRIPTION'], 250); ?&gt;&lt;?php if($record['STREET']===' '){ echo "Not provided" ;}?&gt;&lt;/div&gt;&lt;!-- /.card-row-content --&gt;
              &lt;/div&gt;&lt;!-- /.card-row-body --&gt;
  
              &lt;div class="card-row-properties"&gt;
                  &lt;dl&gt;
  
                          &lt;dd&gt;&lt;/dd&gt;&lt;dt&gt;&lt;a href="&lt;?php echo $record['WEBSITE'];?&gt;"&gt;Visit Website&lt;/a&gt;&lt;/dt&gt;
                          &lt;dd&gt;&lt;/dd&gt;&lt;dt&gt;&lt;a href="http://www.domain/listing-detail.php?ID=&lt;?php echo $record['ID'];?&gt;"&gt;More Info&lt;/a&gt;&lt;/dt&gt;                  
                          &lt;dd&gt;Added&lt;/dd&gt;&lt;dt&gt;&lt;?php echo $record['YA'];?&gt;/&lt;?php echo $record['MU'];?&gt;/&lt;?php echo $record['DU'];?&gt;&lt;/dt&gt;
                          &lt;dd&gt;Viewed&lt;/dd&gt;&lt;dt&gt;Visited&lt;/dt&gt;
  
                  &lt;/dl&gt;
              &lt;/div&gt;&lt;!-- /.card-row-properties --&gt;
          &lt;/div&gt;&lt;!-- /.card-row-inner --&gt;
      &lt;/div&gt;&lt;!-- /.card-row --&gt;
     &lt;/div&gt;&lt;!-- /.cards-row --&gt;
     &lt;br/&gt;
     &lt;?php 
     }
     ?&gt;
  </code></pre>
  
  <p>My goal is to put all the code above inside</p>
  
  <pre><code>while($record = mysql_fetch_array($myData)){ 
  </code></pre>