title: How to set value inside image tag dynamically in a loop using PHP and my sql
body: <p>I need one help.I need to set some DB value dynamically(<code>i.e-image,class</code>) inside a <code>li</code> element using PHP. I am explaining my code below.</p>
  
  <pre><code>&lt;ul class="sequence-canvas"&gt;
    &lt;li class="animate-in"&gt;
      &lt;div class="intro"&gt;
        &lt;h2&gt;My Discount Pharmacy //set title from db&lt;/h2&gt;
        &lt;h3&gt;
  We are an end to end healthcare service provider where the doctors can enter their prescriptions, patients can upload their prescriptions. //set subtitle
        &lt;/h3&gt;
      &lt;/div&gt;
      &lt;img class="iphone" src="img/seq-slider/iphone.png" alt="iPhone4" /&gt; //set image1 from DB
      &lt;img class="iphone-shadow" src="img/seq-slider/iphone-shadow.png" alt="" /&gt; //set image2 from DB
    &lt;/li&gt;
    &lt;li&gt;
      &lt;img class="ipad" src="img/seq-slider/ipad.png" alt="iPad" /&gt;//set image1 from DB
      &lt;div class="slide2"&gt;
        &lt;h2&gt;My Discount Pharmacy // set title from DB&lt;/h2&gt;
        &lt;p&gt;
  We are an end to end healthcare service provider where the doctors can enter their prescriptions, patients can upload their prescriptions. //Set subtitle from DB.
        &lt;/p&gt;
      &lt;/div&gt;
      &lt;img class="ipad-shadow" src="img/seq-slider/ipad-shadow.png" alt="" /&gt;  //set image2 from DB
    &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>From the above code i need to iterate each set of <code>li</code> element in a loop and set some value dynamically.I am explaining my php code below.</p>
  
  <pre><code>&lt;?php 
  $sql = mysql_query("select * from phr_news order by news_id desc");
  
  while ($row=mysql_fetch_array($sql)) {
      $title = $row['title'];
      $subtitle = $row['sub_title'];
      $image1 = $row['image1'];
      $image2 = $row['image2'];
  }
  ?&gt;
  </code></pre>
  
  <p>Here i need to iterate each <code>li</code> element inside loop and set the above values in proper place.Please help me. </p>